summaryrefslogtreecommitdiffstats
path: root/mm/vmstat.c
diff options
context:
space:
mode:
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>2008-05-12 23:02:06 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-13 17:02:23 +0200
commitb5be11329f8cb2cc1a4c3b33b6b8d096c6012895 (patch)
tree30ccea8a490bbde0e0760274b6eb4c5863971caa /mm/vmstat.c
parentm68knommu: ColdFire add support for kernel preemption (missing chunk) (diff)
downloadlinux-b5be11329f8cb2cc1a4c3b33b6b8d096c6012895.tar.xz
linux-b5be11329f8cb2cc1a4c3b33b6b8d096c6012895.zip
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: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Acked-by: Christoph Lameter <clameter@sgi.com> Cc: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmstat.c')
-rw-r--r--mm/vmstat.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 1a32130b958c..db9eabb2c5b3 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -41,7 +41,9 @@ static void sum_vm_events(unsigned long *ret, cpumask_t *cpumask)
*/
void all_vm_events(unsigned long *ret)
{
+ get_online_cpus();
sum_vm_events(ret, &cpu_online_map);
+ put_online_cpus();
}
EXPORT_SYMBOL_GPL(all_vm_events);