mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Acked-by: Christoph Lameter <[email protected]> Reviewed-by: Yasuaki Ishimatsu <[email protected]> Tested-by: Yasuaki Ishimatsu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
c5320926e3
commit
d7e0b37a87
1 changed files with 5 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue