Commit b5be1132 authored by KOSAKI Motohiro's avatar KOSAKI Motohiro Committed by Linus Torvalds

make vmstat cpu-unplug safe

When accessing cpu_online_map, we should prevent dynamic changing
of cpu_online_map by get_online_cpus().

Unfortunately, all_vm_events() doesn't do that.
Signed-off-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: default avatarChristoph Lameter <clameter@sgi.com>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 78f508ab
...@@ -41,7 +41,9 @@ static void sum_vm_events(unsigned long *ret, cpumask_t *cpumask) ...@@ -41,7 +41,9 @@ static void sum_vm_events(unsigned long *ret, cpumask_t *cpumask)
*/ */
void all_vm_events(unsigned long *ret) void all_vm_events(unsigned long *ret)
{ {
get_online_cpus();
sum_vm_events(ret, &cpu_online_map); sum_vm_events(ret, &cpu_online_map);
put_online_cpus();
} }
EXPORT_SYMBOL_GPL(all_vm_events); EXPORT_SYMBOL_GPL(all_vm_events);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment