The patch titled Subject: mm, compaction: distinguish contended status in tracepoints has been added to the -mm tree. Its filename is mm-compaction-disginguish-contended-status-in-tracepoints.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-compaction-disginguish-contended-status-in-tracepoints.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-compaction-disginguish-contended-status-in-tracepoints.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Vlastimil Babka <vbabka@xxxxxxx> Subject: mm, compaction: distinguish contended status in tracepoints Compaction returns prematurely with COMPACT_PARTIAL when contended or has fatal signal pending. This is ok for the callers, but might be misleading in the traces, as the usual reason to return COMPACT_PARTIAL is that we think the allocation should succeed. After this patch we distinguish the premature ending condition in the mm_compaction_finished and mm_compaction_end tracepoints. The contended status covers the following reasons: - lock contention or need_resched() detected in async compaction - fatal signal pending - too many pages isolated in the zone (only for async compaction) Further distinguishing the exact reason seems unnecessary for now. Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/compaction.h | 1 + include/trace/events/compaction.h | 3 ++- mm/compaction.c | 9 ++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff -puN include/linux/compaction.h~mm-compaction-disginguish-contended-status-in-tracepoints include/linux/compaction.h --- a/include/linux/compaction.h~mm-compaction-disginguish-contended-status-in-tracepoints +++ a/include/linux/compaction.h @@ -15,6 +15,7 @@ /* For more detailed tracepoint output */ #define COMPACT_NO_SUITABLE_PAGE 5 #define COMPACT_NOT_SUITABLE_ZONE 6 +#define COMPACT_CONTENDED 7 /* When adding new states, please adjust include/trace/events/compaction.h */ /* Used to signal whether compaction detected need_sched() or lock contention */ diff -puN include/trace/events/compaction.h~mm-compaction-disginguish-contended-status-in-tracepoints include/trace/events/compaction.h --- a/include/trace/events/compaction.h~mm-compaction-disginguish-contended-status-in-tracepoints +++ a/include/trace/events/compaction.h @@ -16,7 +16,8 @@ EM( COMPACT_PARTIAL, "partial") \ EM( COMPACT_COMPLETE, "complete") \ EM( COMPACT_NO_SUITABLE_PAGE, "no_suitable_page") \ - EMe(COMPACT_NOT_SUITABLE_ZONE, "not_suitable_zone") + EM( COMPACT_NOT_SUITABLE_ZONE, "not_suitable_zone") \ + EMe(COMPACT_CONTENDED, "contended") #ifdef CONFIG_ZONE_DMA #define IFDEF_ZONE_DMA(X) X diff -puN mm/compaction.c~mm-compaction-disginguish-contended-status-in-tracepoints mm/compaction.c --- a/mm/compaction.c~mm-compaction-disginguish-contended-status-in-tracepoints +++ a/mm/compaction.c @@ -1202,7 +1202,7 @@ static int __compact_finished(struct zon unsigned long watermark; if (cc->contended || fatal_signal_pending(current)) - return COMPACT_PARTIAL; + return COMPACT_CONTENDED; /* Compaction run completes if the migrate and free scanner meet */ if (compact_scanners_met(cc)) { @@ -1393,7 +1393,7 @@ static int compact_zone(struct zone *zon switch (isolate_migratepages(zone, cc)) { case ISOLATE_ABORT: - ret = COMPACT_PARTIAL; + ret = COMPACT_CONTENDED; putback_movable_pages(&cc->migratepages); cc->nr_migratepages = 0; goto out; @@ -1424,7 +1424,7 @@ static int compact_zone(struct zone *zon * and we want compact_finished() to detect it */ if (err == -ENOMEM && !compact_scanners_met(cc)) { - ret = COMPACT_PARTIAL; + ret = COMPACT_CONTENDED; goto out; } } @@ -1477,6 +1477,9 @@ out: trace_mm_compaction_end(start_pfn, cc->migrate_pfn, cc->free_pfn, end_pfn, sync, ret); + if (ret == COMPACT_CONTENDED) + ret = COMPACT_PARTIAL; + return ret; } _ Patches currently in -mm which might be from vbabka@xxxxxxx are mm-migrate-count-pages-failing-all-retries-in-vmstat-and-tracepoint.patch mm-compaction-export-tracepoints-status-strings-to-userspace.patch mm-compaction-export-tracepoints-zone-names-to-userspace.patch mm-compaction-disginguish-contended-status-in-tracepoints.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html