mm/compaction: only set skip flag if cc->no_set_skip_hint is false
authorKemeng Shi <shikemeng@huaweicloud.com>
Fri, 4 Aug 2023 11:04:54 +0000 (19:04 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 21 Aug 2023 20:37:43 +0000 (13:37 -0700)
Keep the same logic as update_pageblock_skip, only set skip if
no_set_skip_hint is false which is more reasonable.

Link: https://lkml.kernel.org/r/20230804110454.2935878-9-shikemeng@huaweicloud.com
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/compaction.c

index 91a9dfa41ef473d22d373847a498e4652ef68551..fe7b4e7c5d2401aecbefd5290492c4fba0d1e2f3 100644 (file)
@@ -1442,7 +1442,7 @@ fast_isolate_around(struct compact_control *cc, unsigned long pfn)
        isolate_freepages_block(cc, &start_pfn, end_pfn, &cc->freepages, 1, false);
 
        /* Skip this pageblock in the future as it's full or nearly full */
-       if (start_pfn == end_pfn)
+       if (start_pfn == end_pfn && !cc->no_set_skip_hint)
                set_pageblock_skip(page);
 }