]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mm: page_alloc: remove redundant READ_ONCE
authorSongtang Liu <liusongtang@bytedance.com>
Wed, 2 Apr 2025 07:41:16 +0000 (03:41 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 12 May 2025 00:48:07 +0000 (17:48 -0700)
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 <liusongtang@bytedance.com>
Reviewed-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Huang Ying <ying.huang@linux.alibaba.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c

index 8258349e49acb7e6b12f0c10b07e54a9ead0fdee..1ee0e8265888b5256649b0e030b57c99beb412c0 100644 (file)
@@ -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;