linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/page_alloc: Remove redundant pcp->free_count initialization in per_cpu_pages_init()
@ 2025-08-14  7:18 Ye Liu
  2025-08-14  8:40 ` Brendan Jackman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ye Liu @ 2025-08-14  7:18 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka
  Cc: Ye Liu, Suren Baghdasaryan, Michal Hocko, Brendan Jackman,
	Johannes Weiner, Zi Yan, linux-mm, linux-kernel

From: Ye Liu <liuye@kylinos.cn>

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)).

Signed-off-by: Ye Liu <liuye@kylinos.cn>
---
 mm/page_alloc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d1d037f97c5f..64872214bc7d 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -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,
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/page_alloc: Remove redundant pcp->free_count initialization in per_cpu_pages_init()
  2025-08-14  7:18 [PATCH] mm/page_alloc: Remove redundant pcp->free_count initialization in per_cpu_pages_init() Ye Liu
@ 2025-08-14  8:40 ` Brendan Jackman
  2025-08-14 13:59 ` Johannes Weiner
  2025-08-14 14:01 ` Zi Yan
  2 siblings, 0 replies; 4+ messages in thread
From: Brendan Jackman @ 2025-08-14  8:40 UTC (permalink / raw)
  To: Ye Liu, Andrew Morton, Vlastimil Babka
  Cc: Ye Liu, Suren Baghdasaryan, Michal Hocko, Johannes Weiner, Zi Yan,
	linux-mm, linux-kernel

On Thu Aug 14, 2025 at 7:18 AM UTC, Ye Liu wrote:
> From: Ye Liu <liuye@kylinos.cn>
>
> 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)).
>
> Signed-off-by: Ye Liu <liuye@kylinos.cn>

[heroically,]

Reviewed-By: Brendan Jackman <jackmanb@google.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/page_alloc: Remove redundant pcp->free_count initialization in per_cpu_pages_init()
  2025-08-14  7:18 [PATCH] mm/page_alloc: Remove redundant pcp->free_count initialization in per_cpu_pages_init() Ye Liu
  2025-08-14  8:40 ` Brendan Jackman
@ 2025-08-14 13:59 ` Johannes Weiner
  2025-08-14 14:01 ` Zi Yan
  2 siblings, 0 replies; 4+ messages in thread
From: Johannes Weiner @ 2025-08-14 13:59 UTC (permalink / raw)
  To: Ye Liu
  Cc: Andrew Morton, Vlastimil Babka, Ye Liu, Suren Baghdasaryan,
	Michal Hocko, Brendan Jackman, Zi Yan, linux-mm, linux-kernel

On Thu, Aug 14, 2025 at 03:18:28PM +0800, Ye Liu wrote:
> From: Ye Liu <liuye@kylinos.cn>
> 
> 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)).
> 
> Signed-off-by: Ye Liu <liuye@kylinos.cn>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/page_alloc: Remove redundant pcp->free_count initialization in per_cpu_pages_init()
  2025-08-14  7:18 [PATCH] mm/page_alloc: Remove redundant pcp->free_count initialization in per_cpu_pages_init() Ye Liu
  2025-08-14  8:40 ` Brendan Jackman
  2025-08-14 13:59 ` Johannes Weiner
@ 2025-08-14 14:01 ` Zi Yan
  2 siblings, 0 replies; 4+ messages in thread
From: Zi Yan @ 2025-08-14 14:01 UTC (permalink / raw)
  To: Ye Liu
  Cc: Andrew Morton, Vlastimil Babka, Ye Liu, Suren Baghdasaryan,
	Michal Hocko, Brendan Jackman, Johannes Weiner, linux-mm,
	linux-kernel

On 14 Aug 2025, at 3:18, Ye Liu wrote:

> From: Ye Liu <liuye@kylinos.cn>
>
> 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)).
>
> Signed-off-by: Ye Liu <liuye@kylinos.cn>
> ---
>  mm/page_alloc.c | 1 -
>  1 file changed, 1 deletion(-)
>

Reviewed-by: Zi Yan <ziy@nvidia.com>

--
Best Regards,
Yan, Zi


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-08-14 14:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-14  7:18 [PATCH] mm/page_alloc: Remove redundant pcp->free_count initialization in per_cpu_pages_init() Ye Liu
2025-08-14  8:40 ` Brendan Jackman
2025-08-14 13:59 ` Johannes Weiner
2025-08-14 14:01 ` Zi Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).