Subject: + mm-set-n_cpu-to-node_states-during-boot.patch added to -mm tree To: toshi.kani@xxxxxx,cl@xxxxxxxxx,isimatu.yasuaki@xxxxxxxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Tue, 15 Oct 2013 14:44:05 -0700 The patch titled Subject: mm: set N_CPU to node_states during boot has been added to the -mm tree. Its filename is mm-set-n_cpu-to-node_states-during-boot.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-set-n_cpu-to-node_states-during-boot.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-set-n_cpu-to-node_states-during-boot.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: Toshi Kani <toshi.kani@xxxxxx> Subject: mm: set N_CPU to node_states during boot After a system booted, N_CPU is not set to any node as has_cpu shows an empty line. # cat /sys/devices/system/node/has_cpu (show-empty-line) setup_vmstat() registers its CPU notifier callback, vmstat_cpuup_callback(), which marks N_CPU to a node when a CPU is put into online. However, setup_vmstat() is called after all CPUs are launched in the boot sequence. Changed setup_vmstat() to mark N_CPU to the nodes with online CPUs at boot, which is consistent with other operations in vmstat_cpuup_callback(), i.e. start_cpu_timer() and refresh_zone_stat_thresholds(). Also added get_online_cpus() to protect the for_each_online_cpu() loop. Signed-off-by: Toshi Kani <toshi.kani@xxxxxx> Acked-by: Christoph Lameter <cl@xxxxxxxxx> Cc: Yasuaki Ishimatsu <isimatu.yasuaki@xxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/vmstat.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff -puN mm/vmstat.c~mm-set-n_cpu-to-node_states-during-boot mm/vmstat.c --- a/mm/vmstat.c~mm-set-n_cpu-to-node_states-during-boot +++ a/mm/vmstat.c @@ -1276,8 +1276,12 @@ static int __init setup_vmstat(void) register_cpu_notifier(&vmstat_notifier); - for_each_online_cpu(cpu) + get_online_cpus(); + for_each_online_cpu(cpu) { start_cpu_timer(cpu); + node_set_state(cpu_to_node(cpu), N_CPU); + } + put_online_cpus(); #endif #ifdef CONFIG_PROC_FS proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations); _ Patches currently in -mm which might be from toshi.kani@xxxxxx are cpu-mem-hotplug-add-try_online_node-for-cpu_up.patch mm-sparsemem-use-pages_per_section-to-remove-redundant-nr_pages-parameter.patch mm-sparsemem-fix-a-bug-in-free_map_bootmem-when-config_sparsemem_vmemmap.patch mm-sparsemem-fix-a-bug-in-free_map_bootmem-when-config_sparsemem_vmemmap-v2.patch memblock-factor-out-of-top-down-allocation.patch memblock-introduce-bottom-up-allocation-mode.patch x86-mm-factor-out-of-top-down-direct-mapping-setup.patch x86-mem-hotplug-support-initialize-page-tables-in-bottom-up.patch x86-acpi-crash-kdump-do-reserve_crashkernel-after-srat-is-parsed.patch mem-hotplug-introduce-movable_node-boot-option.patch mm-set-n_cpu-to-node_states-during-boot.patch mm-clear-n_cpu-from-node_states-at-cpu-offline.patch linux-next.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