Skip to content

Commit 9ecc5fc

Browse files
gormanmakpm00
authored andcommitted
mm: compaction: only force pageblock scan completion when skip hints are obeyed
fast_find_migrateblock relies on skip hints to avoid rescanning a recently selected pageblock but compact_zone() only forces the pageblock scan completion to set the skip hint if in direct compaction. While this prevents direct compaction repeatedly scanning a subset of blocks due to fast_find_migrateblock(), it does not prevent proactive compaction, node compaction and kcompactd encountering the same problem described in commit cfccd2e ("mm, compaction: finish pageblocks on complete migration failure"). Force the scan completion of a pageblock to set the skip hint if skip hints are obeyed to prevent fast_find_migrateblock() repeatedly selecting a subset of pageblocks. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Mel Gorman <[email protected]> Suggested-by: Vlastimil Babka <[email protected]> Tested-by: Raghavendra K T <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Cc: Chuyi Zhou <[email protected]> Cc: Jiri Slaby <[email protected]> Cc: Maxim Levitsky <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Paolo Bonzini <[email protected]> Cc: Pedro Falcato <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 539aa04 commit 9ecc5fc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mm/compaction.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2457,7 +2457,8 @@ compact_zone(struct compact_control *cc, struct capture_control *capc)
24572457
}
24582458
/*
24592459
* If an ASYNC or SYNC_LIGHT fails to migrate a page
2460-
* within the current order-aligned block, scan the
2460+
* within the current order-aligned block and
2461+
* fast_find_migrateblock may be used then scan the
24612462
* remainder of the pageblock. This will mark the
24622463
* pageblock "skip" to avoid rescanning in the near
24632464
* future. This will isolate more pages than necessary
@@ -2466,7 +2467,7 @@ compact_zone(struct compact_control *cc, struct capture_control *capc)
24662467
* recently partially scanned.
24672468
*/
24682469
if (!pageblock_aligned(cc->migrate_pfn) &&
2469-
cc->direct_compaction && !cc->finish_pageblock &&
2470+
!cc->ignore_skip_hint && !cc->finish_pageblock &&
24702471
(cc->mode < MIGRATE_SYNC)) {
24712472
cc->finish_pageblock = true;
24722473

0 commit comments

Comments
 (0)