From 3c099a2b0b53d98552cd69d19fd76049bcbafe38 Mon Sep 17 00:00:00 2001 From: Kemeng Shi Date: Fri, 21 Jul 2023 23:09:57 +0800 Subject: mm/compaction: avoid unneeded pageblock_end_pfn when no_set_skip_hint is set Move pageblock_end_pfn after no_set_skip_hint check to avoid unneeded pageblock_end_pfn if no_set_skip_hint is set. Link: https://lkml.kernel.org/r/20230721150957.2058634-3-shikemeng@huawei.com Signed-off-by: Kemeng Shi Reviewed-by: Baolin Wang Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton --- mm/compaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mm/compaction.c') diff --git a/mm/compaction.c b/mm/compaction.c index 480f29bcf823..e6ac0ef4c178 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -463,12 +463,12 @@ static void update_cached_migrate(struct compact_control *cc, unsigned long pfn) { struct zone *zone = cc->zone; - pfn = pageblock_end_pfn(pfn); - /* Set for isolation rather than compaction */ if (cc->no_set_skip_hint) return; + pfn = pageblock_end_pfn(pfn); + if (pfn > zone->compact_cached_migrate_pfn[0]) zone->compact_cached_migrate_pfn[0] = pfn; if (cc->mode != MIGRATE_ASYNC && -- cgit v1.2.3