* [mmotm] Cleanup: use for_each_online_cpu in vmstat
@ 2010-06-10 13:32 ` Minchan Kim
0 siblings, 0 replies; 6+ messages in thread
From: Minchan Kim @ 2010-06-10 13:32 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-mm, linux-kernel, Minchan Kim, KOSAKI Motohiro, Christoph Lameter
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.
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Christoph Lameter <cl@linux.com>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
mm/vmstat.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 7759941..15a14b1 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -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);
--
1.7.0.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [mmotm] Cleanup: use for_each_online_cpu in vmstat
@ 2010-06-10 13:32 ` Minchan Kim
0 siblings, 0 replies; 6+ messages in thread
From: Minchan Kim @ 2010-06-10 13:32 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-mm, linux-kernel, Minchan Kim, KOSAKI Motohiro, Christoph Lameter
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.
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Christoph Lameter <cl@linux.com>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
mm/vmstat.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 7759941..15a14b1 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -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);
--
1.7.0.5
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [mmotm] Cleanup: use for_each_online_cpu in vmstat
2010-06-10 13:32 ` Minchan Kim
@ 2010-06-11 13:24 ` Christoph Lameter
-1 siblings, 0 replies; 6+ messages in thread
From: Christoph Lameter @ 2010-06-11 13:24 UTC (permalink / raw)
To: Minchan Kim
Cc: Andrew Morton, linux-mm, linux-kernel, KOSAKI Motohiro,
Christoph Lameter
Acked-by: Christoph Lameter <cl@linux-foundation.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [mmotm] Cleanup: use for_each_online_cpu in vmstat
@ 2010-06-11 13:24 ` Christoph Lameter
0 siblings, 0 replies; 6+ messages in thread
From: Christoph Lameter @ 2010-06-11 13:24 UTC (permalink / raw)
To: Minchan Kim
Cc: Andrew Morton, linux-mm, linux-kernel, KOSAKI Motohiro,
Christoph Lameter
Acked-by: Christoph Lameter <cl@linux-foundation.org>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [mmotm] Cleanup: use for_each_online_cpu in vmstat
2010-06-10 13:32 ` Minchan Kim
@ 2010-06-13 11:24 ` KOSAKI Motohiro
-1 siblings, 0 replies; 6+ messages in thread
From: KOSAKI Motohiro @ 2010-06-13 11:24 UTC (permalink / raw)
To: Minchan Kim
Cc: kosaki.motohiro, Andrew Morton, linux-mm, linux-kernel,
Christoph Lameter
> 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.
>
> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Cc: Christoph Lameter <cl@linux.com>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Thank you.
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [mmotm] Cleanup: use for_each_online_cpu in vmstat
@ 2010-06-13 11:24 ` KOSAKI Motohiro
0 siblings, 0 replies; 6+ messages in thread
From: KOSAKI Motohiro @ 2010-06-13 11:24 UTC (permalink / raw)
To: Minchan Kim
Cc: kosaki.motohiro, Andrew Morton, linux-mm, linux-kernel,
Christoph Lameter
> 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.
>
> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Cc: Christoph Lameter <cl@linux.com>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Thank you.
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-06-13 11:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-10 13:32 [mmotm] Cleanup: use for_each_online_cpu in vmstat Minchan Kim
2010-06-10 13:32 ` Minchan Kim
2010-06-11 13:24 ` Christoph Lameter
2010-06-11 13:24 ` Christoph Lameter
2010-06-13 11:24 ` KOSAKI Motohiro
2010-06-13 11:24 ` KOSAKI Motohiro
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.