diff options
author | Mel Gorman <mgorman@techsingularity.net> | 2023-01-25 13:44:33 +0000 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-02-02 22:33:30 -0800 |
commit | f9d7fc1ae3349759f25903cd867ab72e6ba4a63e (patch) | |
tree | 57cd51d52e2d675bfb06d87a5362ca7c5bece5d6 /mm/compaction.c | |
parent | 16b3be4034316bf56a171478cf1dccdf94dede43 (diff) |
mm, compaction: finish scanning the current pageblock if requested
cc->finish_pageblock is set when the current pageblock should be rescanned
but fast_find_migrateblock can select an alternative block. Disable
fast_find_migrateblock when the current pageblock scan should be
completed.
Link: https://lkml.kernel.org/r/20230125134434.18017-4-mgorman@techsingularity.net
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Cc: Chuyi Zhou <zhouchuyi@bytedance.com>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Maxim Levitsky <mlevitsk@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Pedro Falcato <pedro.falcato@gmail.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/compaction.c')
-rw-r--r-- | mm/compaction.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index a86559910fd9..91acde906ae3 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1762,6 +1762,13 @@ static unsigned long fast_find_migrateblock(struct compact_control *cc) return pfn; /* + * If the pageblock should be finished then do not select a different + * pageblock. + */ + if (cc->finish_pageblock) + return pfn; + + /* * If the migrate_pfn is not at the start of a zone or the start * of a pageblock then assume this is a continuation of a previous * scan restarted due to COMPACT_CLUSTER_MAX. |