From: David Rientjes <rientjes@google.com>
To: linke li <lilinke99@qq.com>
Cc: xujianhao01@gmail.com, Christoph Lameter <cl@linux.com>,
Pekka Enberg <penberg@kernel.org>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@suse.cz>,
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: Sun, 28 Apr 2024 01:10:39 -0700 (PDT) [thread overview]
Message-ID: <1096134d-df6f-185d-240f-8a774d66f98f@google.com> (raw)
In-Reply-To: <tencent_579220610AF1240FE3735A3443DBB01F9D07@qq.com>
On Sat, 27 Apr 2024, 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.
>
Thanks! Do you have a data race report to copy+paste into the commit
description so people can search for it if they stumble across the same
thing?
> Signed-off-by: linke li <lilinke99@qq.com>
> ---
> 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;
> }
> --
> 2.39.3 (Apple Git-146)
>
>
next prev parent reply other threads:[~2024-04-28 8:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-27 8:51 [PATCH] mm/slub: mark racy access on slab->freelist linke li
2024-04-28 8:10 ` David Rientjes [this message]
2024-04-29 2:25 ` linke li
2024-05-02 12:23 ` Vlastimil Babka
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=1096134d-df6f-185d-240f-8a774d66f98f@google.com \
--to=rientjes@google.com \
--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=roman.gushchin@linux.dev \
--cc=vbabka@suse.cz \
--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;
as well as URLs for NNTP newsgroup(s).