Re: [RFC 08/13] mm, compaction: simplify contended compaction handling

From: Vlastimil Babka
Date: Mon May 16 2016 - 03:10:51 EST


On 05/13/2016 03:09 PM, Michal Hocko wrote:
>@@ -1564,14 +1564,11 @@ static enum compact_result compact_zone(struct zone *zone, struct compact_contro
> 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;
> }
This took me a while to grasp but then I realized this is correct
because we shouldn't pretend progress when there was none in fact,
especially when __alloc_pages_direct_compact basically replaced this
"fake" COMPACT_PARTIAL by COMPACT_CONTENDED anyway.

Yes. Actually COMPACT_CONTENDED compact_result used to be just for the tracepoint, and __alloc_pages_direct_compact used another function parameter to signal contention. You changed it with the oom rework so COMPACT_CONTENDED result value was used, so this hunk just makes sure it's still reported correctly.