lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bdecbb1e-96c3-4b91-b21c-ab1ec3ffa3be@arm.com>
Date: Wed, 2 Apr 2025 14:23:18 +0530
From: Anshuman Khandual <anshuman.khandual@....com>
To: Songtang Liu <liusongtang@...edance.com>, akpm@...ux-foundation.org,
 ying.huang@...ux.alibaba.com
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
 zhengqi.arch@...edance.com, songmuchun@...edance.com
Subject: Re: [PATCH] mm: page_alloc: Remove redundant READ_ONCE

On 4/2/25 13:11, Songtang Liu wrote:
> 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")

Although READ_ONCE() should not have been used here with the above
commit - does this cause any problem though ? So in other words is
the Fixes: tag necessary here ?

> Signed-off-by: Songtang Liu <liusongtang@...edance.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;

Otherwise LGTM

Reviewed-by: Anshuman Khandual <anshuman.khandual@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ