linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: linke li <lilinke99@qq.com>
Cc: xujianhao01@gmail.com, Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/slub: mark racy access on slab->freelist
Date: Thu, 2 May 2024 14:23:21 +0200	[thread overview]
Message-ID: <203b39b1-fd83-4fc6-9d55-004d998494f2@suse.cz> (raw)
In-Reply-To: <tencent_579220610AF1240FE3735A3443DBB01F9D07@qq.com>

On 4/27/24 10:51, linke li wrote:
> In deactivate_slab(), slab->freelist can be changed concurrently. Mark
> data race on slab->freelist as benign using READ_ONCE.
> 
> This patch is aimed at reducing the number of benign races reported by
> KCSAN in order to focus future debugging effort on harmful races.
> 
> Signed-off-by: linke li <lilinke99@qq.com>

Added to slab/for-6.10, thanks

> ---
>  mm/slub.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/slub.c b/mm/slub.c
> index 0d700f6ca547..bb0e05a321e9 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -2813,7 +2813,7 @@ static void deactivate_slab(struct kmem_cache *s, struct slab *slab,
>  	struct slab new;
>  	struct slab old;
>  
> -	if (slab->freelist) {
> +	if (READ_ONCE(slab->freelist)) {
>  		stat(s, DEACTIVATE_REMOTE_FREES);
>  		tail = DEACTIVATE_TO_TAIL;
>  	}


      parent reply	other threads:[~2024-05-02 12:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-27  8:51 linke li
2024-04-28  8:10 ` David Rientjes
2024-04-29  2:25   ` linke li
2024-05-02 12:23 ` Vlastimil Babka [this message]

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=203b39b1-fd83-4fc6-9d55-004d998494f2@suse.cz \
    --to=vbabka@suse.cz \
    --cc=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=lilinke99@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=xujianhao01@gmail.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