diff options
author | Minchan Kim <minchan.kim@gmail.com> | 2010-08-09 20:18:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-09 23:44:57 -0400 |
commit | 31f961a89bd1cb9baaf32af4bd8b571ace3447b1 (patch) | |
tree | add1380e479ff92ad92da090e606857162b88e66 /mm | |
parent | 0aad4b3124850e85fe54e610802f0917ce46a1ae (diff) |
mm: use for_each_online_cpu() in vmstat
The sum_vm_events passes cpumask for for_each_cpu(). But it's useless
since we have for_each_online_cpu. Althougth it's tirival overhead, it's
not good about coding consistency.
Let's use for_each_online_cpu instead of for_each_cpu with cpumask
argument.
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Christoph Lameter <cl@linux-foundation.org>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/vmstat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c index 7759941d4e77..15a14b16e176 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c | |||
@@ -22,14 +22,14 @@ | |||
22 | DEFINE_PER_CPU(struct vm_event_state, vm_event_states) = {{0}}; | 22 | DEFINE_PER_CPU(struct vm_event_state, vm_event_states) = {{0}}; |
23 | EXPORT_PER_CPU_SYMBOL(vm_event_states); | 23 | EXPORT_PER_CPU_SYMBOL(vm_event_states); |
24 | 24 | ||
25 | static void sum_vm_events(unsigned long *ret, const struct cpumask *cpumask) | 25 | static void sum_vm_events(unsigned long *ret) |
26 | { | 26 | { |
27 | int cpu; | 27 | int cpu; |
28 | int i; | 28 | int i; |
29 | 29 | ||
30 | memset(ret, 0, NR_VM_EVENT_ITEMS * sizeof(unsigned long)); | 30 | memset(ret, 0, NR_VM_EVENT_ITEMS * sizeof(unsigned long)); |
31 | 31 | ||
32 | for_each_cpu(cpu, cpumask) { | 32 | for_each_online_cpu(cpu) { |
33 | struct vm_event_state *this = &per_cpu(vm_event_states, cpu); | 33 | struct vm_event_state *this = &per_cpu(vm_event_states, cpu); |
34 | 34 | ||
35 | for (i = 0; i < NR_VM_EVENT_ITEMS; i++) | 35 | for (i = 0; i < NR_VM_EVENT_ITEMS; i++) |
@@ -45,7 +45,7 @@ static void sum_vm_events(unsigned long *ret, const struct cpumask *cpumask) | |||
45 | void all_vm_events(unsigned long *ret) | 45 | void all_vm_events(unsigned long *ret) |
46 | { | 46 | { |
47 | get_online_cpus(); | 47 | get_online_cpus(); |
48 | sum_vm_events(ret, cpu_online_mask); | 48 | sum_vm_events(ret); |
49 | put_online_cpus(); | 49 | put_online_cpus(); |
50 | } | 50 | } |
51 | EXPORT_SYMBOL_GPL(all_vm_events); | 51 | EXPORT_SYMBOL_GPL(all_vm_events); |