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>
This commit is contained in:
KOSAKI Motohiro 2008-05-12 14:02:06 -07:00 committed by Linus Torvalds
parent 78f508ab07
commit b5be11329f
1 changed files with 2 additions and 0 deletions

View File

@ -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);