Re: [PATCH RESEND part2 v2 8/8] x86, numa, acpi, memory-hotplug: Make movable_node have higher priority

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 03, 2013 at 10:30:23AM +0800, Zhang Yanfei wrote:
> From: Tang Chen <tangchen@xxxxxxxxxxxxxx>
> 
> If users specify the original movablecore=nn@ss boot option, the kernel will
> arrange [ss, ss+nn) as ZONE_MOVABLE. The kernelcore=nn@ss boot option is similar
> except it specifies ZONE_NORMAL ranges.
> 
> Now, if users specify "movable_node" in kernel commandline, the kernel will
> arrange hotpluggable memory in SRAT as ZONE_MOVABLE. And if users do this, all
> the other movablecore=nn@ss and kernelcore=nn@ss options should be ignored.
> 
> For those who don't want this, just specify nothing. The kernel will act as
> before.
> 
> Signed-off-by: Tang Chen <tangchen@xxxxxxxxxxxxxx>
> Signed-off-by: Zhang Yanfei <zhangyanfei@xxxxxxxxxxxxxx>
> Reviewed-by: Wanpeng Li <liwanp@xxxxxxxxxxxxxxxxxx>
> ---
>  mm/page_alloc.c |   28 ++++++++++++++++++++++++++--
>  1 files changed, 26 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index dd886fa..768ea0e 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -5021,9 +5021,33 @@ static void __init find_zone_movable_pfns_for_nodes(void)
>  	nodemask_t saved_node_state = node_states[N_MEMORY];
>  	unsigned long totalpages = early_calculate_totalpages();
>  	int usable_nodes = nodes_weight(node_states[N_MEMORY]);
> +	struct memblock_type *type = &memblock.memory;
> +
> +	/* Need to find movable_zone earlier when movable_node is specified. */
> +	find_usable_zone_for_movable();
> +
> +	/*
> +	 * If movable_node is specified, ignore kernelcore and movablecore
> +	 * options.
> +	 */
> +	if (movable_node_is_enabled()) {
> +		for (i = 0; i < type->cnt; i++) {
> +			if (!memblock_is_hotpluggable(&type->regions[i]))
> +				continue;
> +
> +			nid = type->regions[i].nid;
> +
> +			usable_startpfn = PFN_DOWN(type->regions[i].base);
> +			zone_movable_pfn[nid] = zone_movable_pfn[nid] ?
> +				min(usable_startpfn, zone_movable_pfn[nid]) :
> +				usable_startpfn;
> +		}
> +
> +		goto out2;

out2 is not the most descriptive variable that ever existed. out_align?

There is an assumption here that the hot-pluggable regions of memory
are always at the upper end of the physical address space for that NUMA
node. What prevents the hardware having something like

node0:	0-4G	Not removable
node0:	4-8G	Removable
node0:	8-12G	Not removable

?

By the looks of things, the current code would make ZONE_MOVABLE for the
while 4-12G range of memory even though the 8-12G region cannot be
hot-removed. That would compound any problems related to lowmem-like
pressure as the 8-12G region cannot be used for kernel allocations like
inodes.

-- 
Mel Gorman
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]