[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080605102647.9C26.KOSAKI.MOTOHIRO@jp.fujitsu.com>
Date: Thu, 05 Jun 2008 10:29:41 +0900
From: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To: kosaki.motohiro@...fujitsu.com
Cc: kosaki.motohiro@...fujitsu.com,
LKML <linux-kernel@...r.kernel.org>,
linux-mm <linux-mm@...ck.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Rik van Riel <riel@...hat.com>
Subject: Re: [PATCH 2/5] introduce get_vm_event().
> introduce get_vm_event() new function for easy use vm statics.
>
>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
sorry, this patch already get Rik-san's ACK.
I'll append it and resend by this mail.
------------------------------------
introduce get_vm_event() new function for easy use vm statics.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Acked-by: Rik van Riel <riel@...hat.com>
---
include/linux/vmstat.h | 7 ++++++-
mm/vmstat.c | 16 ++++++++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
Index: b/include/linux/vmstat.h
===================================================================
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -98,6 +98,8 @@ static inline void vm_events_fold_cpu(in
}
#endif
+unsigned long get_vm_event(enum vm_event_item event_type);
+
#else
/* Disable counters */
@@ -119,7 +121,10 @@ static inline void all_vm_events(unsigne
static inline void vm_events_fold_cpu(int cpu)
{
}
-
+static inline unsigned long get_vm_event(enum vm_event_item event_type)
+{
+ return 0;
+}
#endif /* CONFIG_VM_EVENT_COUNTERS */
#define __count_zone_vm_events(item, zone, delta) \
Index: b/mm/vmstat.c
===================================================================
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -49,6 +49,22 @@ void all_vm_events(unsigned long *ret)
}
EXPORT_SYMBOL_GPL(all_vm_events);
+unsigned long get_vm_event(enum vm_event_item event_type)
+{
+ int cpu;
+ unsigned long ret = 0;
+
+ get_online_cpus();
+ for_each_online_cpu(cpu) {
+ struct vm_event_state *this = &per_cpu(vm_event_states, cpu);
+
+ ret += this->event[event_type];
+ }
+ put_online_cpus();
+
+ return ret;
+}
+
#ifdef CONFIG_HOTPLUG
/*
* Fold the foreign cpu events into our own.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists