From patchwork Mon Jul 21 03:46:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 33941 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0D33520492 for ; Mon, 21 Jul 2014 03:58:23 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id la4sf18673942vcb.2 for ; Sun, 20 Jul 2014 20:58:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=okPgwX29FILhJftWt97ceIuztrCGt27wuyx0B/G3V1Y=; b=mRMqX4nIrDJsnniTygyOMAuT5E0FlG1CdaEpN6QJ/He4PoxEsd9LEHmDU3S20xogcZ iGzLgP8fypSXYtrcyYNqCf2/aZYDxsSCh3Jn1JYIbd1jOQQ4KKneGQcEsEqmaVACyXYs vlD8oJD6s12Z2sRA0jSG1y2eOAHJWrGqtu74qItbjYQB3ljfXR2JCdHV+S7k63TuHRXT 5knJn6LH4KV8STBPS3hjmSKnbM9mpwauQyaBWZO/WngxHyXDsIfTw5ec+V3ADBJAoRod eXwKAeD5fosButl4RHIfCklXNZx5TrMy5Ppgiz6gudEjqOOHfMRT1B+6tlYeEaVwHnrD 3duA== X-Gm-Message-State: ALoCoQnXdSTDq2nInqB/LGRACIB+kH4VPtNPCZQyWnyu6mYDfc/FUkb84+9YU8ZCeEJj70cR0xJf X-Received: by 10.52.165.227 with SMTP id zb3mr9607207vdb.1.1405915102821; Sun, 20 Jul 2014 20:58:22 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.21.203 with SMTP id 69ls243382qgl.13.gmail; Sun, 20 Jul 2014 20:58:22 -0700 (PDT) X-Received: by 10.52.248.146 with SMTP id ym18mr22214469vdc.8.1405915102734; Sun, 20 Jul 2014 20:58:22 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id n6si2041557vec.0.2014.07.20.20.58.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 20 Jul 2014 20:58:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id hq11so9684981vcb.30 for ; Sun, 20 Jul 2014 20:58:22 -0700 (PDT) X-Received: by 10.221.24.135 with SMTP id re7mr6856953vcb.53.1405915102618; Sun, 20 Jul 2014 20:58:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp80014vcb; Sun, 20 Jul 2014 20:58:22 -0700 (PDT) X-Received: by 10.66.234.202 with SMTP id ug10mr6947303pac.109.1405915101754; Sun, 20 Jul 2014 20:58:21 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yh2si12855013pbb.130.2014.07.20.20.58.21; Sun, 20 Jul 2014 20:58:21 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752885AbaGUD5I (ORCPT + 9 others); Sun, 20 Jul 2014 23:57:08 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:25251 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752188AbaGUD46 (ORCPT ); Sun, 20 Jul 2014 23:56:58 -0400 Received: from 172.24.2.119 (EHLO lggeml420-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BYZ66477; Mon, 21 Jul 2014 11:56:46 +0800 (CST) Received: from kernel-host.huawei (10.107.197.247) by lggeml420-hub.china.huawei.com (10.72.61.115) with Microsoft SMTP Server id 14.3.158.1; Mon, 21 Jul 2014 11:56:32 +0800 From: Wang Nan To: Ingo Molnar , Yinghai Lu , "Mel Gorman" , Andrew Morton , "Dave Hansen" , Zhang Yanfei CC: , , , , , , , Subject: [PATCH v2 2/7] memory-hotplug: x86_64: suitable memory should go to ZONE_MOVABLE Date: Mon, 21 Jul 2014 11:46:37 +0800 Message-ID: <1405914402-66212-3-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1405914402-66212-1-git-send-email-wangnan0@huawei.com> References: <1405914402-66212-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.107.197.247] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: wangnan0@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch introduces zone_for_memory() to arch_add_memory() on x86_64 to ensure new, higher memory added into ZONE_MOVABLE if movable zone has already setup. Signed-off-by: Wang Nan Cc: Zhang Yanfei Cc: Dave Hansen --- arch/x86/mm/init_64.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index df1a992..5621c47 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -691,7 +691,8 @@ static void update_end_of_memory_vars(u64 start, u64 size) int arch_add_memory(int nid, u64 start, u64 size) { struct pglist_data *pgdat = NODE_DATA(nid); - struct zone *zone = pgdat->node_zones + ZONE_NORMAL; + struct zone *zone = pgdat->node_zones + + zone_for_memory(nid, start, size, ZONE_NORMAL); unsigned long start_pfn = start >> PAGE_SHIFT; unsigned long nr_pages = size >> PAGE_SHIFT; int ret;