Skip to content

Commit

Permalink
make vmstat cpu-unplug safe
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Christoph Lameter <[email protected]>
Cc: Gautham R Shenoy <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
kosaki authored and torvalds committed May 13, 2008
1 parent 78f508a commit b5be113
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mm/vmstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit b5be113

Please sign in to comment.