[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130924124121.GG2366@htj.dyndns.org>
Date: Tue, 24 Sep 2013 08:41:21 -0400
From: Tejun Heo <tj@...nel.org>
To: Zhang Yanfei <zhangyanfei@...fujitsu.com>
Cc: "Rafael J . Wysocki" <rjw@...k.pl>, lenb@...nel.org,
Thomas Gleixner <tglx@...utronix.de>, mingo@...e.hu,
"H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Toshi Kani <toshi.kani@...com>,
Wanpeng Li <liwanp@...ux.vnet.ibm.com>,
Thomas Renninger <trenn@...e.de>,
Yinghai Lu <yinghai@...nel.org>,
Jiang Liu <jiang.liu@...wei.com>,
Wen Congyang <wency@...fujitsu.com>,
Lai Jiangshan <laijs@...fujitsu.com>,
isimatu.yasuaki@...fujitsu.com, izumi.taku@...fujitsu.com,
Mel Gorman <mgorman@...e.de>, Minchan Kim <minchan@...nel.org>,
mina86@...a86.com, gong.chen@...ux.intel.com,
vasilis.liaskovitis@...fitbricks.com, lwoodman@...hat.com,
Rik van Riel <riel@...hat.com>, jweiner@...hat.com,
prarit@...hat.com, "x86@...nel.org" <x86@...nel.org>,
linux-doc@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Linux MM <linux-mm@...ck.org>, linux-acpi@...r.kernel.org,
imtangchen@...il.com, Zhang Yanfei <zhangyanfei.yes@...il.com>
Subject: Re: [PATCH 6/6] mem-hotplug: Introduce movablenode boot option
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).
> +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?
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists