memcg: add mm_vmscan_memcg_isolate tracepoint
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Tue, 10 Aug 2010 00:19:57 +0000 (17:19 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 10 Aug 2010 03:45:03 +0000 (20:45 -0700)
Memcg also need to trace page isolation information as global reclaim.
This patch does it.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/trace/events/vmscan.h
mm/memcontrol.c

index d9656444a7ca661ac3a7eb71e1e1086d74faae37..370aa5a87322fa686f3f6b59474e67bf9cf94567 100644 (file)
@@ -231,6 +231,21 @@ DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate,
 
 );
 
+DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate,
+
+       TP_PROTO(int order,
+               unsigned long nr_requested,
+               unsigned long nr_scanned,
+               unsigned long nr_taken,
+               unsigned long nr_lumpy_taken,
+               unsigned long nr_lumpy_dirty,
+               unsigned long nr_lumpy_failed,
+               int isolate_mode),
+
+       TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode)
+
+);
+
 TRACE_EVENT(mm_vmscan_writepage,
 
        TP_PROTO(struct page *page,
index de54ea0094a1be4e512b0ac602e28d2a3ac4a695..0576e9e64586df7dd0aa0d182966c32df92384c2 100644 (file)
@@ -51,6 +51,8 @@
 
 #include <asm/uaccess.h>
 
+#include <trace/events/vmscan.h>
+
 struct cgroup_subsys mem_cgroup_subsys __read_mostly;
 #define MEM_CGROUP_RECLAIM_RETRIES     5
 struct mem_cgroup *root_mem_cgroup __read_mostly;
@@ -1007,6 +1009,10 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
        }
 
        *scanned = scan;
+
+       trace_mm_vmscan_memcg_isolate(0, nr_to_scan, scan, nr_taken,
+                                     0, 0, 0, mode);
+
        return nr_taken;
 }