Skip to content

Commit

Permalink
mm: use for_each_online_cpu() in vmstat
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: KAMEZAWA Hiroyuki <[email protected]>
Acked-by: Christoph Lameter <[email protected]>
Reviewed-by: KOSAKI Motohiro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Minchan Kim authored and torvalds committed Aug 10, 2010
1 parent 0aad4b3 commit 31f961a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mm/vmstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
DEFINE_PER_CPU(struct vm_event_state, vm_event_states) = {{0}};
EXPORT_PER_CPU_SYMBOL(vm_event_states);

static void sum_vm_events(unsigned long *ret, const struct cpumask *cpumask)
static void sum_vm_events(unsigned long *ret)
{
int cpu;
int i;

memset(ret, 0, NR_VM_EVENT_ITEMS * sizeof(unsigned long));

for_each_cpu(cpu, cpumask) {
for_each_online_cpu(cpu) {
struct vm_event_state *this = &per_cpu(vm_event_states, cpu);

for (i = 0; i < NR_VM_EVENT_ITEMS; i++)
Expand All @@ -45,7 +45,7 @@ static void sum_vm_events(unsigned long *ret, const struct cpumask *cpumask)
void all_vm_events(unsigned long *ret)
{
get_online_cpus();
sum_vm_events(ret, cpu_online_mask);
sum_vm_events(ret);
put_online_cpus();
}
EXPORT_SYMBOL_GPL(all_vm_events);
Expand Down

0 comments on commit 31f961a

Please sign in to comment.