From: "Gupta, Pankaj" <pankaj.gupta@amd.com>
To: Songtang Liu <liusongtang@bytedance.com>,
akpm@linux-foundation.org, ying.huang@linux.alibaba.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
zhengqi.arch@bytedance.com, songmuchun@bytedance.com
Subject: Re: [PATCH] mm: page_alloc: Remove redundant READ_ONCE
Date: Wed, 2 Apr 2025 11:27:02 +0200 [thread overview]
Message-ID: <0928be02-d439-4ece-9924-9146a2658d76@amd.com> (raw)
In-Reply-To: <CAA=HWd1kn01ym8YuVFuAqK2Ggq3itEGkqX8T6eCXs_C7tiv-Jw@mail.gmail.com>
> 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.
>
> Fixes: 51a755c56dc0 ("mm: tune PCP high automatically")
> Signed-off-by: Songtang Liu <liusongtang@bytedance.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com>
> ---
> 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 e3ea5bf5c459..6edc6e57d4f8 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -2661,7 +2661,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;
next prev parent reply other threads:[~2025-04-02 9:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-02 7:41 Songtang Liu
2025-04-02 7:59 ` Qi Zheng
2025-04-02 8:30 ` Huang, Ying
2025-04-02 8:53 ` Anshuman Khandual
2025-04-02 9:27 ` Gupta, Pankaj [this message]
2025-04-02 9:32 ` Oscar Salvador
2025-04-02 19:01 ` Vishal Moola (Oracle)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0928be02-d439-4ece-9924-9146a2658d76@amd.com \
--to=pankaj.gupta@amd.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liusongtang@bytedance.com \
--cc=songmuchun@bytedance.com \
--cc=ying.huang@linux.alibaba.com \
--cc=zhengqi.arch@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox