aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>2015-02-11 18:27:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-11 20:06:04 -0500
commit16c4a097a035c01809aa0c0abd458ca1fe4ff3d0 (patch)
treefe961117b89c43c293d4914c5301ec59da390c6b /mm
parent4645f06334be1ad0eb61aa182c7999fe51bc1ba6 (diff)
mm/compaction: enhance tracepoint output for compaction begin/end
We now have tracepoint for begin event of compaction and it prints start position of both scanners, but, tracepoint for end event of compaction doesn't print finish position of both scanners. It'd be also useful to know finish position of both scanners so this patch add it. It will help to find odd behavior or problem on compaction internal logic. And mode is added to both begin/end tracepoint output, since according to mode, compaction behavior is quite different. And lastly, status format is changed to string rather than status number for readability. [akpm@linux-foundation.org: fix sparse warning] Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> Cc: Mel Gorman <mgorman@suse.de> Cc: David Rientjes <rientjes@google.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/compaction.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/mm/compaction.c b/mm/compaction.c
index 9c7e6909dd29..66f7c365e888 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -34,6 +34,15 @@ static inline void count_compact_events(enum vm_event_item item, long delta)
34#endif 34#endif
35 35
36#if defined CONFIG_COMPACTION || defined CONFIG_CMA 36#if defined CONFIG_COMPACTION || defined CONFIG_CMA
37#ifdef CONFIG_TRACEPOINTS
38static const char *const compaction_status_string[] = {
39 "deferred",
40 "skipped",
41 "continue",
42 "partial",
43 "complete",
44};
45#endif
37 46
38#define CREATE_TRACE_POINTS 47#define CREATE_TRACE_POINTS
39#include <trace/events/compaction.h> 48#include <trace/events/compaction.h>
@@ -1197,7 +1206,8 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
1197 zone->compact_cached_migrate_pfn[1] = cc->migrate_pfn; 1206 zone->compact_cached_migrate_pfn[1] = cc->migrate_pfn;
1198 } 1207 }
1199 1208
1200 trace_mm_compaction_begin(start_pfn, cc->migrate_pfn, cc->free_pfn, end_pfn); 1209 trace_mm_compaction_begin(start_pfn, cc->migrate_pfn,
1210 cc->free_pfn, end_pfn, sync);
1201 1211
1202 migrate_prep_local(); 1212 migrate_prep_local();
1203 1213
@@ -1299,7 +1309,8 @@ out:
1299 zone->compact_cached_free_pfn = free_pfn; 1309 zone->compact_cached_free_pfn = free_pfn;
1300 } 1310 }
1301 1311
1302 trace_mm_compaction_end(ret); 1312 trace_mm_compaction_end(start_pfn, cc->migrate_pfn,
1313 cc->free_pfn, end_pfn, sync, ret);
1303 1314
1304 return ret; 1315 return ret;
1305} 1316}