From: "Paul E. McKenney" <paulmck@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Qian Cai <cai@lca.pw>, elver@google.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] lib: disable KCSAN for XArray
Date: Tue, 3 Mar 2020 20:05:15 -0800 [thread overview]
Message-ID: <20200304040515.GX2935@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <20200304033329.GZ29971@bombadil.infradead.org>
On Tue, Mar 03, 2020 at 07:33:29PM -0800, Matthew Wilcox wrote:
> On Tue, Mar 03, 2020 at 10:15:51PM -0500, Qian Cai wrote:
> > Functions like xas_find_marked(), xas_set_mark(), and xas_clear_mark()
> > could happen concurrently result in data races, but those operate only
> > on a single bit that are pretty much harmless. For example,
>
> Those aren't data races. The writes are protected by a spinlock and the
> reads by the RCU read lock. If the tool can't handle RCU protection,
> it's not going to be much use.
Would KCSAN's ASSERT_EXCLUSIVE_BITS() help here?
If not, you lost me on this one. RCU readers don't exclude lock-based
writers.
RCU readers -do- exclude pre-insertion initialization on the one hand,
and those post-removal accesses that follow a grace period, but only
if that grace period starts after the removal. In addition, the
accesses due to rcu_dereference(), rcu_assign_pointer(), and similar
are guaranteed to work even if they are concurrent.
Or am I missing something subtle here?
That said, you are permitted to define "data race" for your subsystem
by choosing KCSAN settings, up to and including keeping KCSAN out
entirely.
Thanx, Paul
next prev parent reply other threads:[~2020-03-04 4:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-04 3:15 Qian Cai
2020-03-04 3:33 ` Matthew Wilcox
2020-03-04 3:55 ` Qian Cai
2020-03-04 4:00 ` Matthew Wilcox
2020-03-04 4:05 ` Paul E. McKenney [this message]
2020-03-04 4:33 ` Matthew Wilcox
2020-03-04 14:10 ` Paul E. McKenney
2020-03-04 16:40 ` Marco Elver
2020-03-04 17:10 ` Qian Cai
2020-03-04 17:14 ` Paul E. McKenney
2020-03-05 15:18 ` Matthew Wilcox
2020-03-05 21:39 ` Paul E. McKenney
2020-03-06 13:38 ` Marco Elver
2020-03-06 16:53 ` Matthew Wilcox
2020-03-06 17:03 ` Paul E. McKenney
2020-03-06 20:04 ` Marco Elver
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=20200304040515.GX2935@paulmck-ThinkPad-P72 \
--to=paulmck@kernel.org \
--cc=cai@lca.pw \
--cc=elver@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=willy@infradead.org \
/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
all inboxes | Powered by JetHome®