Subject: + x86-numa-acpi-memory-hotplug-make-movable_node-have-higher-priority.patch added to -mm tree To: tangchen@xxxxxxxxxxxxxx,gong.chen@xxxxxxxxxxxxxxx,hannes@xxxxxxxxxxx,hpa@xxxxxxxxx,imtangchen@xxxxxxxxx,isimatu.yasuaki@xxxxxxxxxxxxxx,izumi.taku@xxxxxxxxxxxxxx,jiang.liu@xxxxxxxxxx,laijs@xxxxxxxxxxxxxx,lenb@xxxxxxxxxx,liwanp@xxxxxxxxxxxxxxxxxx,lwoodman@xxxxxxxxxx,mgorman@xxxxxxx,mina86@xxxxxxxxxx,minchan@xxxxxxxxxx,mingo@xxxxxxx,prarit@xxxxxxxxxx,riel@xxxxxxxxxx,rjw@xxxxxxx,tglx@xxxxxxxxxxxxx,tj@xxxxxxxxxx,toshi.kani@xxxxxx,trenn@xxxxxxx,vasilis.liaskovitis@xxxxxxxxxxxxxxxx,wency@xxxxxxxxxxxxxx,yinghai@xxxxxxxxxx,zhangyanfei@xxxxxxxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Tue, 03 Dec 2013 15:54:49 -0800 The patch titled Subject: x86, numa, acpi, memory-hotplug: make movable_node have higher priority has been added to the -mm tree. Its filename is x86-numa-acpi-memory-hotplug-make-movable_node-have-higher-priority.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/x86-numa-acpi-memory-hotplug-make-movable_node-have-higher-priority.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/x86-numa-acpi-memory-hotplug-make-movable_node-have-higher-priority.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Tang Chen <tangchen@xxxxxxxxxxxxxx> Subject: x86, numa, acpi, memory-hotplug: make movable_node have higher priority 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> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx> Cc: "Rafael J . Wysocki" <rjw@xxxxxxx> Cc: Chen Tang <imtangchen@xxxxxxxxx> Cc: Gong Chen <gong.chen@xxxxxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: Jiang Liu <jiang.liu@xxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Lai Jiangshan <laijs@xxxxxxxxxxxxxx> Cc: Larry Woodman <lwoodman@xxxxxxxxxx> Cc: Len Brown <lenb@xxxxxxxxxx> Cc: Liu Jiang <jiang.liu@xxxxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxx> Cc: Michal Nazarewicz <mina86@xxxxxxxxxx> Cc: Minchan Kim <minchan@xxxxxxxxxx> Cc: Prarit Bhargava <prarit@xxxxxxxxxx> Cc: Rik van Riel <riel@xxxxxxxxxx> Cc: Taku Izumi <izumi.taku@xxxxxxxxxxxxxx> Cc: Tejun Heo <tj@xxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Thomas Renninger <trenn@xxxxxxx> Cc: Toshi Kani <toshi.kani@xxxxxx> Cc: Vasilis Liaskovitis <vasilis.liaskovitis@xxxxxxxxxxxxxxxx> Cc: Wen Congyang <wency@xxxxxxxxxxxxxx> Cc: Yasuaki Ishimatsu <isimatu.yasuaki@xxxxxxxxxxxxxx> Cc: Yinghai Lu <yinghai@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_alloc.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff -puN mm/page_alloc.c~x86-numa-acpi-memory-hotplug-make-movable_node-have-higher-priority mm/page_alloc.c --- a/mm/page_alloc.c~x86-numa-acpi-memory-hotplug-make-movable_node-have-higher-priority +++ a/mm/page_alloc.c @@ -5019,9 +5019,33 @@ static void __init find_zone_movable_pfn 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; + } /* - * If movablecore was specified, calculate what size of + * If movablecore=nn[KMG] was specified, calculate what size of * kernelcore that corresponds so that memory usable for * any allocation type is evenly spread. If both kernelcore * and movablecore are specified, then the value of kernelcore @@ -5047,7 +5071,6 @@ static void __init find_zone_movable_pfn goto out; /* usable_startpfn is the lowest possible pfn ZONE_MOVABLE can be at */ - find_usable_zone_for_movable(); usable_startpfn = arch_zone_lowest_possible_pfn[movable_zone]; restart: @@ -5138,6 +5161,7 @@ restart: if (usable_nodes && required_kernelcore > usable_nodes) goto restart; +out2: /* Align start of ZONE_MOVABLE on all nids to MAX_ORDER_NR_PAGES */ for (nid = 0; nid < MAX_NUMNODES; nid++) zone_movable_pfn[nid] = _ Patches currently in -mm which might be from tangchen@xxxxxxxxxxxxxx are x86-get-pg_data_ts-memory-from-other-node.patch memblock-numa-introduce-flags-field-into-memblock.patch memblock-mem_hotplug-introduce-memblock_hotplug-flag-to-mark-hotpluggable-regions.patch memblock-make-memblock_set_node-support-different-memblock_type.patch acpi-numa-mem_hotplug-mark-hotpluggable-memory-in-memblock.patch acpi-numa-mem_hotplug-mark-all-nodes-the-kernel-resides-un-hotpluggable.patch memblock-mem_hotplug-make-memblock-skip-hotpluggable-regions-if-needed.patch x86-numa-acpi-memory-hotplug-make-movable_node-have-higher-priority.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html