Cleanup: use for_each_online_cpu in vmstat
Subsystems (2)
Sorry. It's not [1/2] and I used Chrisopth's old mail address. Resend.
--
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.
--- mm/vmstat.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
mm/vmstat.c +3 -3
@@ -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++)
@@ -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);
Signature · 1 line
1.7.0.5
Christoph Lameter
Acked-by--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
KOSAKI Motohiro
Reviewed-byQuoted 10 lines
Sorry. It's not [1/2] and I used Chrisopth's old mail address. Resend.
--
The
sum_vm_eventspasses cpumask forfor_each_cpu. But it's useless since we havefor_each_online_cpu. Althougth it's tirival overhead, it's not good about coding consistency.
Quoted 6 lines
Let's use
for_each_online_cpuinstead offor_each_cpuwith cpumask argument.Cc KOSAKI Motohiro <[email protected]>Cc Christoph Lameter <[email protected]>Signed-off-by Minchan Kim <[email protected]>
Thank you.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>