The patch titled Subject: mm: update _mem_id_[] for every possible CPU when memory configuration changes has been added to the -mm tree. Its filename is mm-update-_mem_id_-for-every-possible-cpu-when-memory-configuration-changes.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-update-_mem_id_-for-every-possible-cpu-when-memory-configuration-changes.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-update-_mem_id_-for-every-possible-cpu-when-memory-configuration-changes.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: Jiang Liu <jiang.liu@xxxxxxxxxxxxxxx> Subject: mm: update _mem_id_[] for every possible CPU when memory configuration changes Current kernel only updates _mem_id_[cpu] for onlined CPUs when memory configuration changes. So kernel may allocate memory from remote node for a CPU if the CPU is still in absent or offline state even if the node associated with the CPU has already been onlined. This patch tries to improve performance by updating _mem_id_[cpu] for each possible CPU when memory configuration changes, thus kernel could always allocate from local node once the node is onlined. We check node_online(cpu_to_node(cpu)) because: 1) local_memory_node(nid) needs to access NODE_DATA(nid) 2) try_offline_node(nid) just zeroes out NODE_DATA(nid) instead of free it Signed-off-by: Jiang Liu <jiang.liu@xxxxxxxxxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Mike Galbraith <umgwanakikbuti@xxxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Cc: "Rafael J . Wysocki" <rafael.j.wysocki@xxxxxxxxx> Cc: Tang Chen <tangchen@xxxxxxxxxxxxxx> Cc: Tejun Heo <tj@xxxxxxxxxx> Cc: Tony Luck <tony.luck@xxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_alloc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff -puN mm/page_alloc.c~mm-update-_mem_id_-for-every-possible-cpu-when-memory-configuration-changes mm/page_alloc.c --- a/mm/page_alloc.c~mm-update-_mem_id_-for-every-possible-cpu-when-memory-configuration-changes +++ a/mm/page_alloc.c @@ -4368,13 +4368,13 @@ static int __build_all_zonelists(void *d /* * We now know the "local memory node" for each node-- * i.e., the node of the first zone in the generic zonelist. - * Set up numa_mem percpu variable for on-line cpus. During - * boot, only the boot cpu should be on-line; we'll init the - * secondary cpus' numa_mem as they come on-line. During - * node/memory hotplug, we'll fixup all on-line cpus. + * Set up numa_mem percpu variable for all possible cpus + * if associated node has been onlined. */ - if (cpu_online(cpu)) + if (node_online(cpu_to_node(cpu))) set_cpu_numa_mem(cpu, local_memory_node(cpu_to_node(cpu))); + else + set_cpu_numa_mem(cpu, NUMA_NO_NODE); #endif } _ Patches currently in -mm which might be from jiang.liu@xxxxxxxxxxxxxxx are linux-next.patch x86-numa-acpi-online-node-earlier-when-doing-cpu-hot-addition.patch kernel-profilec-replace-cpu_to_mem-with-cpu_to_node.patch sgi-xp-replace-cpu_to_node-with-cpu_to_mem-to-support-memoryless-node.patch openvswitch-replace-cpu_to_node-with-cpu_to_mem-to-support-memoryless-node.patch i40e-use-numa_mem_id-to-better-support-memoryless-node.patch i40evf-use-numa_mem_id-to-better-support-memoryless-node.patch x86-numa-kill-useless-code-to-improve-code-readability.patch mm-update-_mem_id_-for-every-possible-cpu-when-memory-configuration-changes.patch mm-x86-enable-memoryless-node-support-to-better-support-cpu-memory-hotplug.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