Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932326Ab3FMN24 (ORCPT ); Thu, 13 Jun 2013 09:28:56 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:6846 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1758164Ab3FMN2V (ORCPT ); Thu, 13 Jun 2013 09:28:21 -0400 X-IronPort-AV: E=Sophos;i="4.87,858,1363104000"; d="scan'208";a="7537719" From: Tang Chen To: tglx@linutronix.de, mingo@elte.hu, hpa@zytor.com, akpm@linux-foundation.org, tj@kernel.org, trenn@suse.de, yinghai@kernel.org, jiang.liu@huawei.com, wency@cn.fujitsu.com, laijs@cn.fujitsu.com, isimatu.yasuaki@jp.fujitsu.com, mgorman@suse.de, minchan@kernel.org, mina86@mina86.com, gong.chen@linux.intel.com, vasilis.liaskovitis@profitbricks.com, lwoodman@redhat.com, riel@redhat.com, jweiner@redhat.com, prarit@redhat.com Cc: x86@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [Part2 PATCH v4 03/15] page_alloc, mem-hotplug: Improve movablecore to {en|dis}able using SRAT. Date: Thu, 13 Jun 2013 21:03:27 +0800 Message-Id: <1371128619-8987-4-git-send-email-tangchen@cn.fujitsu.com> X-Mailer: git-send-email 1.7.10.1 In-Reply-To: <1371128619-8987-1-git-send-email-tangchen@cn.fujitsu.com> References: <1371128619-8987-1-git-send-email-tangchen@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/06/13 20:58:45, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/06/13 20:59:02, Serialize complete at 2013/06/13 20:59:02 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2694 Lines: 82 The Hot-Pluggable Fired in SRAT specified which memory ranges are hotpluggable. We will arrange hotpluggable memory as ZONE_MOVABLE for users who want to use memory hotplug functionality. But this will cause NUMA performance decreased because kernel cannot use ZONE_MOVABLE. So we improve movablecore boot option to allow those who want to use memory hotplug functionality to enable using SRAT info to arrange movable memory. Users can specify "movablecore=acpi" in kernel commandline to enable this functionality. For those who don't use memory hotplug or who don't want to lose their NUMA performance, just don't specify anything. The kernel will work as before. Suggested-by: Kamezawa Hiroyuki Signed-off-by: Tang Chen Reviewed-by: Wanpeng Li --- include/linux/memory_hotplug.h | 3 +++ mm/page_alloc.c | 13 +++++++++++++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 3e622c6..0b21e54 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h @@ -33,6 +33,9 @@ enum { ONLINE_MOVABLE, }; +/* Enable/disable SRAT in movablecore boot option */ +extern bool movablecore_enable_srat; + /* * pgdat resizing functions */ diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 7ba7703..ee5ae49 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -209,6 +209,8 @@ static unsigned long __initdata required_kernelcore; static unsigned long __initdata required_movablecore; static unsigned long __meminitdata zone_movable_pfn[MAX_NUMNODES]; +bool __initdata movablecore_enable_srat; + /* movable_zone is the "real" zone pages in ZONE_MOVABLE are taken from */ int movable_zone; EXPORT_SYMBOL(movable_zone); @@ -5062,6 +5064,12 @@ void __init free_area_init_nodes(unsigned long *max_zone_pfn) } } +static void __init cmdline_movablecore_srat(char *p) +{ + if (p && !strcmp(p, "acpi")) + movablecore_enable_srat = true; +} + static int __init cmdline_parse_core(char *p, unsigned long *core) { unsigned long long coremem; @@ -5092,6 +5100,11 @@ static int __init cmdline_parse_kernelcore(char *p) */ static int __init cmdline_parse_movablecore(char *p) { + cmdline_movablecore_srat(p); + + if (movablecore_enable_srat) + return 0; + return cmdline_parse_core(p, &required_movablecore); } -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/