From: Mel Gorman Date: Wed, 25 Jan 2023 13:44:32 +0000 (+0000) Subject: mm, compaction: check if a page has been captured before draining PCP pages X-Git-Tag: v6.6.17~5460^2~192 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=16b3be4034316bf56a171478cf1dccdf94dede43;p=platform%2Fkernel%2Flinux-rpi.git 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 Cc: Chuyi Zhou Cc: Jiri Slaby Cc: Maxim Levitsky Cc: Michal Hocko Cc: Paolo Bonzini Cc: Pedro Falcato Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- 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: