Commit 3c099a2b authored by Kemeng Shi's avatar Kemeng Shi Committed by Andrew Morton

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.comSigned-off-by: default avatarKemeng Shi <shikemeng@huawei.com>
Reviewed-by: default avatarBaolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent e6bd14ec
...@@ -463,12 +463,12 @@ static void update_cached_migrate(struct compact_control *cc, unsigned long pfn) ...@@ -463,12 +463,12 @@ static void update_cached_migrate(struct compact_control *cc, unsigned long pfn)
{ {
struct zone *zone = cc->zone; struct zone *zone = cc->zone;
pfn = pageblock_end_pfn(pfn);
/* Set for isolation rather than compaction */ /* Set for isolation rather than compaction */
if (cc->no_set_skip_hint) if (cc->no_set_skip_hint)
return; return;
pfn = pageblock_end_pfn(pfn);
if (pfn > zone->compact_cached_migrate_pfn[0]) if (pfn > zone->compact_cached_migrate_pfn[0])
zone->compact_cached_migrate_pfn[0] = pfn; zone->compact_cached_migrate_pfn[0] = pfn;
if (cc->mode != MIGRATE_ASYNC && if (cc->mode != MIGRATE_ASYNC &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment