aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2010-08-09 20:19:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-09 23:44:59 -0400
commita8a94d151521b248727c1f88756174e15260815a (patch)
tree81ea18e9c52f6260f9b52b16e592cc89bfd9d260
parent33906bc5c87b50028364405ec425de9638afc719 (diff)
vmscan: tracing: add trace events for LRU page isolation
Add an event for when pages are isolated en-masse from the LRU lists. This event augments the information available on LRU traffic and can be used to evaluate lumpy reclaim. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Rik van Riel <riel@redhat.com> Acked-by: Larry Woodman <lwoodman@redhat.com> Cc: Dave Chinner <david@fromorbit.com> Cc: Chris Mason <chris.mason@oracle.com> Cc: Nick Piggin <npiggin@suse.de> Cc: Rik van Riel <riel@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Michael Rubin <mrubin@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/trace/events/vmscan.h46
-rw-r--r--mm/vmscan.c16
2 files changed, 62 insertions, 0 deletions
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
index f76521ffe7df..c0552be1f50a 100644
--- a/include/trace/events/vmscan.h
+++ b/include/trace/events/vmscan.h
@@ -109,6 +109,52 @@ TRACE_EVENT(mm_vmscan_direct_reclaim_end,
109 TP_printk("nr_reclaimed=%lu", __entry->nr_reclaimed) 109 TP_printk("nr_reclaimed=%lu", __entry->nr_reclaimed)
110); 110);
111 111
112TRACE_EVENT(mm_vmscan_lru_isolate,
113
114 TP_PROTO(int order,
115 unsigned long nr_requested,
116 unsigned long nr_scanned,
117 unsigned long nr_taken,
118 unsigned long nr_lumpy_taken,
119 unsigned long nr_lumpy_dirty,
120 unsigned long nr_lumpy_failed,
121 int isolate_mode),
122
123 TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode),
124
125 TP_STRUCT__entry(
126 __field(int, order)
127 __field(unsigned long, nr_requested)
128 __field(unsigned long, nr_scanned)
129 __field(unsigned long, nr_taken)
130 __field(unsigned long, nr_lumpy_taken)
131 __field(unsigned long, nr_lumpy_dirty)
132 __field(unsigned long, nr_lumpy_failed)
133 __field(int, isolate_mode)
134 ),
135
136 TP_fast_assign(
137 __entry->order = order;
138 __entry->nr_requested = nr_requested;
139 __entry->nr_scanned = nr_scanned;
140 __entry->nr_taken = nr_taken;
141 __entry->nr_lumpy_taken = nr_lumpy_taken;
142 __entry->nr_lumpy_dirty = nr_lumpy_dirty;
143 __entry->nr_lumpy_failed = nr_lumpy_failed;
144 __entry->isolate_mode = isolate_mode;
145 ),
146
147 TP_printk("isolate_mode=%d order=%d nr_requested=%lu nr_scanned=%lu nr_taken=%lu contig_taken=%lu contig_dirty=%lu contig_failed=%lu",
148 __entry->isolate_mode,
149 __entry->order,
150 __entry->nr_requested,
151 __entry->nr_scanned,
152 __entry->nr_taken,
153 __entry->nr_lumpy_taken,
154 __entry->nr_lumpy_dirty,
155 __entry->nr_lumpy_failed)
156);
157
112#endif /* _TRACE_VMSCAN_H */ 158#endif /* _TRACE_VMSCAN_H */
113 159
114/* This part must be outside protection */ 160/* This part must be outside protection */
diff --git a/mm/vmscan.c b/mm/vmscan.c
index c99bc418c4cf..3d006d91a526 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -919,6 +919,9 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
919 unsigned long *scanned, int order, int mode, int file) 919 unsigned long *scanned, int order, int mode, int file)
920{ 920{
921 unsigned long nr_taken = 0; 921 unsigned long nr_taken = 0;
922 unsigned long nr_lumpy_taken = 0;
923 unsigned long nr_lumpy_dirty = 0;
924 unsigned long nr_lumpy_failed = 0;
922 unsigned long scan; 925 unsigned long scan;
923 926
924 for (scan = 0; scan < nr_to_scan && !list_empty(src); scan++) { 927 for (scan = 0; scan < nr_to_scan && !list_empty(src); scan++) {
@@ -996,12 +999,25 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
996 list_move(&cursor_page->lru, dst); 999 list_move(&cursor_page->lru, dst);
997 mem_cgroup_del_lru(cursor_page); 1000 mem_cgroup_del_lru(cursor_page);
998 nr_taken++; 1001 nr_taken++;
1002 nr_lumpy_taken++;
1003 if (PageDirty(cursor_page))
1004 nr_lumpy_dirty++;
999 scan++; 1005 scan++;
1006 } else {
1007 if (mode == ISOLATE_BOTH &&
1008 page_count(cursor_page))
1009 nr_lumpy_failed++;
1000 } 1010 }
1001 } 1011 }
1002 } 1012 }
1003 1013
1004 *scanned = scan; 1014 *scanned = scan;
1015
1016 trace_mm_vmscan_lru_isolate(order,
1017 nr_to_scan, scan,
1018 nr_taken,
1019 nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed,
1020 mode);
1005 return nr_taken; 1021 return nr_taken;
1006} 1022}
1007 1023