diff options
author | Mel Gorman <mgorman@techsingularity.net> | 2023-01-25 14:44:32 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-02-03 07:33:30 +0100 |
commit | 16b3be4034316bf56a171478cf1dccdf94dede43 (patch) | |
tree | 9cd103253f0a04b489215017c009d25c543633a0 /mm/compaction.c | |
parent | mm, compaction: rename compact_control->rescan to finish_pageblock (diff) | |
download | linux-16b3be4034316bf56a171478cf1dccdf94dede43.tar.xz linux-16b3be4034316bf56a171478cf1dccdf94dede43.zip |
mm, compaction: check if a page has been captured before draining PCP pages
If a page has been captured then draining is unnecssary so check first for
a captured page.
Link: https://lkml.kernel.org/r/20230125134434.18017-3-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 | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index 28a9596609fe..a86559910fd9 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2439,6 +2439,12 @@ compact_zone(struct compact_control *cc, struct capture_control *capc) } } + /* Stop if a page has been captured */ + if (capc && capc->page) { + ret = COMPACT_SUCCESS; + break; + } + check_drain: /* * Has the migration scanner moved away from the previous @@ -2457,12 +2463,6 @@ check_drain: last_migrated_pfn = 0; } } - - /* Stop if a page has been captured */ - if (capc && capc->page) { - ret = COMPACT_SUCCESS; - break; - } } out: |