Skip to content

Commit

Permalink
mm, compaction: finish scanning the current pageblock if requested
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mel Gorman authored and Andrew Morton committed Feb 3, 2023
1 parent 16b3be4 commit f9d7fc1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mm/compaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -1761,6 +1761,13 @@ static unsigned long fast_find_migrateblock(struct compact_control *cc)
if (cc->ignore_skip_hint)
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
Expand Down

0 comments on commit f9d7fc1

Please sign in to comment.