From patchwork Fri Jul 18 07:56:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 33824 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9E2E520CA0 for ; Fri, 18 Jul 2014 08:12:26 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id m1sf12391832oag.3 for ; Fri, 18 Jul 2014 01:12:26 -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=IKwyYtLwcYHJD8H/Q0khCtxZTMrwSBYq5iXdh4IoYR8=; b=OvK2upZuwYHlAlxLXyac2vk9ZvNpo9vFlNVj1DCn9EmAAyFweFrznUS9Lv2dabWF2q eVgZV2w3EBf3GUOc9VVS1XIfpOyY4Q7mlVQhp9+b45jrONqEZcDTMHokoDmwiGz4RUzy 8Z64bHtkgDTjqd8T50ZEqkqEQ7EBb3Myb292n+chipZzr9mzPFvrEtC220O7+UUxPKDD i3qVZcSbiNGTHcyV/9Iz6JQvqMMFRrogEGZg6m6reYA9arrg0WrokDqVpsr5nIJv7V7k r85WMgK0QIEY7mfruH5siDPFCiXwfStnKeXN2cLPbRDoU4iUAX6nq4XsGzm5CcTJm4gI YeZA== X-Gm-Message-State: ALoCoQmV322LIM9iL57YQiJQzh9DTi6aFwYwrODThyJ750Rz/ZPsWASFXHPdojdks4iWk4bgFJDY X-Received: by 10.182.213.105 with SMTP id nr9mr1686331obc.36.1405671146180; Fri, 18 Jul 2014 01:12:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.203 with SMTP id c69ls904000qgd.85.gmail; Fri, 18 Jul 2014 01:12:26 -0700 (PDT) X-Received: by 10.220.144.10 with SMTP id x10mr3099738vcu.42.1405671146077; Fri, 18 Jul 2014 01:12:26 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id ju5si4969938veb.53.2014.07.18.01.12.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Jul 2014 01:12:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id hy4so6583793vcb.22 for ; Fri, 18 Jul 2014 01:12:26 -0700 (PDT) X-Received: by 10.52.37.81 with SMTP id w17mr751501vdj.95.1405671145980; Fri, 18 Jul 2014 01:12:25 -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 tc5csp101249vcb; Fri, 18 Jul 2014 01:12:25 -0700 (PDT) X-Received: by 10.70.37.71 with SMTP id w7mr2822876pdj.87.1405671145038; Fri, 18 Jul 2014 01:12:25 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ou8si2520627pdb.247.2014.07.18.01.12.24; Fri, 18 Jul 2014 01:12:24 -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 S1760703AbaGRILq (ORCPT + 23 others); Fri, 18 Jul 2014 04:11:46 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:42573 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753577AbaGRIKO (ORCPT ); Fri, 18 Jul 2014 04:10:14 -0400 Received: from 172.24.2.119 (EHLO lggeml406-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BWW27600; Fri, 18 Jul 2014 16:05:56 +0800 (CST) Received: from kernel-host.huawei (10.107.197.247) by lggeml406-hub.china.huawei.com (10.72.61.84) with Microsoft SMTP Server id 14.3.158.1; Fri, 18 Jul 2014 16:05:47 +0800 From: Wang Nan To: Ingo Molnar , Yinghai Lu , "Mel Gorman" , Andrew Morton CC: Pei Feiyue , , , , , , Subject: [PATCH 3/5] memory-hotplug: ia64: suitable memory should go to ZONE_MOVABLE Date: Fri, 18 Jul 2014 15:56:01 +0800 Message-ID: <1405670163-53747-4-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1405670163-53747-1-git-send-email-wangnan0@huawei.com> References: <1405670163-53747-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.177 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 add new memory to ZONE_MOVABLE if movable zone is setup and lower than newly added memory for ia64. Signed-off-by: Wang Nan --- arch/ia64/mm/init.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index 25c3502..d81c916 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c @@ -625,6 +625,7 @@ int arch_add_memory(int nid, u64 start, u64 size) { pg_data_t *pgdat; struct zone *zone; + struct zone *movable_zone; unsigned long start_pfn = start >> PAGE_SHIFT; unsigned long nr_pages = size >> PAGE_SHIFT; int ret; @@ -632,6 +633,12 @@ int arch_add_memory(int nid, u64 start, u64 size) pgdat = NODE_DATA(nid); zone = pgdat->node_zones + ZONE_NORMAL; + movable_zone = pgdat->node_zones + ZONE_MOVABLE; + if (!zone_is_empty(movable_zone)) + if (zone_spans_pfn(movable_zone, start_pfn) || + (zone_end_pfn(movable_zone) <= start_pfn)) + zone = movable_zone; + ret = __add_pages(nid, zone, start_pfn, nr_pages); if (ret)