From cd348c5e6af3b4220eb37a08fdaf9c924a2e1c19 Mon Sep 17 00:00:00 2001 From: Songtang Liu Date: Wed, 2 Apr 2025 03:41:16 -0400 Subject: [PATCH] mm: page_alloc: remove redundant READ_ONCE In the current code, batch is a local variable, and it cannot be concurrently modified. It's unnecessary to use READ_ONCE here, so remove it. Link: https://lkml.kernel.org/r/CAA=HWd1kn01ym8YuVFuAqK2Ggq3itEGkqX8T6eCXs_C7tiv-Jw@mail.gmail.com Fixes: 51a755c56dc0 ("mm: tune PCP high automatically") Signed-off-by: Songtang Liu Reviewed-by: Qi Zheng Reviewed-by: Huang Ying Reviewed-by: Anshuman Khandual Reviewed-by: Pankaj Gupta Reviewed-by: Oscar Salvador Reviewed-by: Vishal Moola (Oracle) Cc: Muchun Song Signed-off-by: Andrew Morton --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 8258349e49ac..1ee0e8265888 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2675,7 +2675,7 @@ static void free_frozen_page_commit(struct zone *zone, free_high = (pcp->free_count >= batch && (pcp->flags & PCPF_PREV_FREE_HIGH_ORDER) && (!(pcp->flags & PCPF_FREE_HIGH_BATCH) || - pcp->count >= READ_ONCE(batch))); + pcp->count >= batch)); pcp->flags |= PCPF_PREV_FREE_HIGH_ORDER; } else if (pcp->flags & PCPF_PREV_FREE_HIGH_ORDER) { pcp->flags &= ~PCPF_PREV_FREE_HIGH_ORDER; -- 2.50.1