Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753154Ab3IXNcV (ORCPT ); Tue, 24 Sep 2013 09:32:21 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:55150 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882Ab3IXNcT (ORCPT ); Tue, 24 Sep 2013 09:32:19 -0400 Message-ID: <5241944B.4050103@gmail.com> Date: Tue, 24 Sep 2013 21:31:55 +0800 From: Zhang Yanfei User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20120607 Thunderbird/10.0.5 MIME-Version: 1.0 To: Tejun Heo CC: Zhang Yanfei , "Rafael J . Wysocki" , lenb@kernel.org, Thomas Gleixner , mingo@elte.hu, "H. Peter Anvin" , Andrew Morton , Toshi Kani , Wanpeng Li , Thomas Renninger , Yinghai Lu , Jiang Liu , Wen Congyang , Lai Jiangshan , isimatu.yasuaki@jp.fujitsu.com, izumi.taku@jp.fujitsu.com, Mel Gorman , Minchan Kim , mina86@mina86.com, gong.chen@linux.intel.com, vasilis.liaskovitis@profitbricks.com, lwoodman@redhat.com, Rik van Riel , jweiner@redhat.com, prarit@redhat.com, "x86@kernel.org" , linux-doc@vger.kernel.org, "linux-kernel@vger.kernel.org" , Linux MM , linux-acpi@vger.kernel.org, imtangchen@gmail.com Subject: Re: [PATCH 6/6] mem-hotplug: Introduce movablenode boot option References: <524162DA.30004@cn.fujitsu.com> <5241655E.1000007@cn.fujitsu.com> <20130924124121.GG2366@htj.dyndns.org> In-Reply-To: <20130924124121.GG2366@htj.dyndns.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2666 Lines: 80 On 09/24/2013 08:41 PM, Tejun Heo wrote: > Hello, > > On Tue, Sep 24, 2013 at 06:11:42PM +0800, Zhang Yanfei wrote: >> diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c >> index 36cfce3..2cf04fd 100644 >> --- a/arch/x86/kernel/setup.c >> +++ b/arch/x86/kernel/setup.c >> @@ -1132,6 +1132,14 @@ void __init setup_arch(char **cmdline_p) >> early_acpi_boot_init(); >> >> initmem_init(); >> + >> + /* >> + * When ACPI SRAT is parsed, which is done in initmem_init(), >> + * set memblock back to the top-down direction. >> + */ >> + if (memblock_bottom_up()) >> + memblock_set_bottom_up(false); > > I don't think you need the if (). Just call > memblock_set_bottom_up(false). OK, will remove it. > >> +static int __init cmdline_parse_movablenode(char *p) >> +{ >> + /* >> + * Memory used by the kernel cannot be hot-removed because Linux >> + * cannot migrate the kernel pages. When memory hotplug is >> + * enabled, we should prevent memblock from allocating memory >> + * for the kernel. >> + * >> + * ACPI SRAT records all hotpluggable memory ranges. But before >> + * SRAT is parsed, we don't know about it. >> + * >> + * The kernel image is loaded into memory at very early time. We >> + * cannot prevent this anyway. So on NUMA system, we set any >> + * node the kernel resides in as un-hotpluggable. >> + * >> + * Since on modern servers, one node could have double-digit >> + * gigabytes memory, we can assume the memory around the kernel >> + * image is also un-hotpluggable. So before SRAT is parsed, just >> + * allocate memory near the kernel image to try the best to keep >> + * the kernel away from hotpluggable memory. >> + */ >> + memblock_set_bottom_up(true); >> + return 0; >> +} >> +early_param("movablenode", cmdline_parse_movablenode); > > This came up during earlier review but never was addressed. Is > "movablenode" the right name? Shouldn't it be something which > explicitly shows that it's to prepare for memory hotplug? Also, maybe > the above param should generate warning if CONFIG_MOVABLE_NODE isn't > enabled? hmmm...as for the option name, if this option is set, it means, the kernel could support the functionality that a whole node is the so called movable node, which only has ZONE MOVABLE zone in it. So we choose to name the parameter "movablenode". As for the warning, will add it. Thanks > > Thanks. > -- Thanks. Zhang Yanfei -- 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/