From: Songtang Liu Date: Wed, 2 Apr 2025 07:41:16 +0000 (-0400) Subject: mm: page_alloc: remove redundant READ_ONCE X-Git-Tag: v6.16-rc1~92^2~262 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd348c5e6af3b4220eb37a08fdaf9c924a2e1c19;p=thirdparty%2Fkernel%2Fstable.git 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 --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 8258349e49acb..1ee0e8265888b 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;