[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230515113344.6869-3-mgorman@techsingularity.net>
Date: Mon, 15 May 2023 12:33:42 +0100
From: Mel Gorman <mgorman@...hsingularity.net>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Maxim Levitsky <mlevitsk@...hat.com>,
Michal Hocko <mhocko@...nel.org>,
Pedro Falcato <pedro.falcato@...il.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Chuyi Zhou <zhouchuyi@...edance.com>,
Linux-MM <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>,
Mel Gorman <mgorman@...hsingularity.net>
Subject: [PATCH 2/4] 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 cfccd2e63e7e ("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.
Suggested-by: Vlastimil Babka <vbabka@...e.cz>
Signed-off-by: Mel Gorman <mgorman@...hsingularity.net>
---
mm/compaction.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/compaction.c b/mm/compaction.c
index 81791c124bb8..accc6568091a 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -2456,7 +2456,8 @@ compact_zone(struct compact_control *cc, struct capture_control *capc)
}
/*
* If an ASYNC or SYNC_LIGHT fails to migrate a page
- * within the current order-aligned block, scan the
+ * within the current order-aligned block and
+ * fast_find_migrateblock may be used then scan the
* remainder of the pageblock. This will mark the
* pageblock "skip" to avoid rescanning in the near
* future. This will isolate more pages than necessary
@@ -2465,7 +2466,7 @@ compact_zone(struct compact_control *cc, struct capture_control *capc)
* recently partially scanned.
*/
if (!pageblock_aligned(cc->migrate_pfn) &&
- cc->direct_compaction && !cc->finish_pageblock &&
+ !cc->ignore_skip_hint && !cc->finish_pageblock &&
(cc->mode < MIGRATE_SYNC)) {
cc->finish_pageblock = true;
--
2.35.3
Powered by blists - more mailing lists