Re: [PATCH 08/11] mm, compaction: Simplify __alloc_pages_direct_compact feedback interface

From: Vlastimil Babka
Date: Mon Apr 11 2016 - 09:50:05 EST


On 04/05/2016 01:25 PM, Michal Hocko wrote:
From: Michal Hocko <mhocko@xxxxxxxx>

__alloc_pages_direct_compact communicates potential back off by two
variables:
- deferred_compaction tells that the compaction returned
COMPACT_DEFERRED
- contended_compaction is set when there is a contention on
zone->lock resp. zone->lru_lock locks

__alloc_pages_slowpath then backs of for THP allocation requests to
prevent from long stalls. This is rather messy and it would be much
cleaner to return a single compact result value and hide all the nasty
details into __alloc_pages_direct_compact.

On the other hand, the nasty subtle details of THP allocation handling are now split between __alloc_pages_direct_compact and __alloc_pages_slowpath(). Lesser evil, I guess. I wish we could get rid of these special cases, now that latency of THP direct allocations is reduced by Mel's new defaults.

This patch shouldn't introduce any functional changes.

Signed-off-by: Michal Hocko <mhocko@xxxxxxxx>

Acked-by: Vlastimil Babka <vbabka@xxxxxxx>