Skip to content

Commit 3e321ca

Browse files
Songtang Liuopsiff
authored andcommitted
mm: page_alloc: remove redundant READ_ONCE
mainline inclusion from mainline-v6.16-rc1 category: bugfix 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: 51a755c ("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> (cherry picked from commit cd348c5) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 1f8f536 commit 3e321ca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mm/page_alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2521,7 +2521,7 @@ static void free_unref_page_commit(struct zone *zone, struct per_cpu_pages *pcp,
25212521
free_high = (pcp->free_count >= batch &&
25222522
(pcp->flags & PCPF_PREV_FREE_HIGH_ORDER) &&
25232523
(!(pcp->flags & PCPF_FREE_HIGH_BATCH) ||
2524-
pcp->count >= READ_ONCE(batch)));
2524+
pcp->count >= batch));
25252525
pcp->flags |= PCPF_PREV_FREE_HIGH_ORDER;
25262526
} else if (pcp->flags & PCPF_PREV_FREE_HIGH_ORDER) {
25272527
pcp->flags &= ~PCPF_PREV_FREE_HIGH_ORDER;

0 commit comments

Comments
 (0)