mm, compaction: distinguish COMPACT_DEFERRED from COMPACT_SKIPPED
try_to_compact_pages() can currently return COMPACT_SKIPPED even when the compaction is defered for some zone just because zone DMA is skipped in 99% of cases due to watermark checks. This makes COMPACT_DEFERRED basically unusable for the page allocator as a feedback mechanism. Make sure we distinguish those two states properly and switch their ordering in the enum. This would mean that the COMPACT_SKIPPED will be returned only when all eligible zones are skipped. As a result COMPACT_DEFERRED handling for THP in __alloc_pages_slowpath will be more precise and we would bail out rather than reclaim. Signed-off-by: Michal Hocko <mhocko@suse.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com> Cc: David Rientjes <rientjes@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Joonsoo Kim <js1304@gmail.com> Cc: Mel Gorman <mgorman@techsingularity.net> Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Cc: Vladimir Davydov <vdavydov@virtuozzo.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
c46649deae
commit
1d4746d395
@@ -10,8 +10,8 @@
|
||||
#include <trace/events/mmflags.h>
|
||||
|
||||
#define COMPACTION_STATUS \
|
||||
EM( COMPACT_DEFERRED, "deferred") \
|
||||
EM( COMPACT_SKIPPED, "skipped") \
|
||||
EM( COMPACT_DEFERRED, "deferred") \
|
||||
EM( COMPACT_CONTINUE, "continue") \
|
||||
EM( COMPACT_PARTIAL, "partial") \
|
||||
EM( COMPACT_COMPLETE, "complete") \
|
||||
|
Reference in New Issue
Block a user