]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/page_alloc: remove redundant pcp->free_count initialization in per_cpu_pages_init()
authorYe Liu <liuye@kylinos.cn>
Thu, 14 Aug 2025 07:18:28 +0000 (15:18 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 12 Sep 2025 00:25:00 +0000 (17:25 -0700)
In per_cpu_pages_init(), pcp->free_count is explicitly initialized to 0,
but this is redundant because the entire struct is already zeroed by
memset(pcp, 0, sizeof(*pcp)).

Link: https://lkml.kernel.org/r/20250814071828.12036-1-ye.liu@linux.dev
Signed-off-by: Ye Liu <liuye@kylinos.cn>
Reviewed-by: Brendan Jackman <jackmanb@google.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c

index fd55ca824c47bf207656226900695ffeb5237c4c..2ee21e46f0fb4badaa824914b56cf9086afdbfdf 100644 (file)
@@ -5946,7 +5946,6 @@ static void per_cpu_pages_init(struct per_cpu_pages *pcp, struct per_cpu_zonesta
        pcp->high_min = BOOT_PAGESET_HIGH;
        pcp->high_max = BOOT_PAGESET_HIGH;
        pcp->batch = BOOT_PAGESET_BATCH;
-       pcp->free_count = 0;
 }
 
 static void __zone_set_pageset_high_and_batch(struct zone *zone, unsigned long high_min,