From: Peter Zijlstra <peterz@infradead.org>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com,
dipankar@in.ibm.com, akpm@linux-foundation.org,
mathieu.desnoyers@efficios.com, josh@joshtriplett.org,
tglx@linutronix.de, rostedt@goodmis.org, dhowells@redhat.com,
edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com,
joel@joelfernandes.org
Subject: Re: [PATCH tip/core/rcu 1/3] rcu-tasks: *_ONCE() for rcu_tasks_cbs_head
Date: Tue, 18 Feb 2020 08:56:48 +0100 [thread overview]
Message-ID: <20200218075648.GW14914@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20200217181615.GP2935@paulmck-ThinkPad-P72>
On Mon, Feb 17, 2020 at 10:16:16AM -0800, Paul E. McKenney wrote:
> On Mon, Feb 17, 2020 at 01:38:51PM +0100, Peter Zijlstra wrote:
> > On Fri, Feb 14, 2020 at 04:25:18PM -0800, paulmck@kernel.org wrote:
> > > From: "Paul E. McKenney" <paulmck@kernel.org>
> > >
> > > The RCU tasks list of callbacks, rcu_tasks_cbs_head, is sampled locklessly
> > > by rcu_tasks_kthread() when waiting for work to do. This commit therefore
> > > applies READ_ONCE() to that lockless sampling and WRITE_ONCE() to the
> > > single potential store outside of rcu_tasks_kthread.
> > >
> > > This data race was reported by KCSAN. Not appropriate for backporting
> > > due to failure being unlikely.
> >
> > What failure is possible here? AFAICT this is (again) one of them
> > load-complare-against-constant-discard patterns that are impossible to
> > mess up.
>
> First, please keep in mind that this is RCU code. Rather uncomplicated
> for RCU, to be sure, but still RCU code.
>
> The failure modes are thus as follows:
>
> o I produce a patch for which KCSAN gives a legitimate warning,
> but this warning is obscured by a pile of other warnings.
> Yes, we should continue improving KCSAN's ability to adapt
> to the users desired compiler-optimization risk level, but
> in RCU's case that risk level is set quite low.
>
> In RCU, what others are calling false positives are therefore
> addressed. Yes, this does cost me a bit of work, but it is
> trivial compared to the work required to track down a real bug.
>
> o Someone optimizes or otherwise changes the wait/wakeup code,
> which inadvertently gives the compiler more scope for mischief.
>
> In short, within RCU, I am handling all KCSAN complaints. This is looking
> to be an extremely inexpensive insurance policy for RCU. Other subsystems
> are of course free to make their own tradeoffs, and subsystems having
> less-aggressive concurrency control might be well-advised to take a
> different path than the one I am taking.
I just took offence at the Changelog wording. It seems to suggest there
actually is a problem, there is not.
next prev parent reply other threads:[~2020-02-18 7:57 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-15 0:24 [PATCH tip/core/rcu 0/3] Tasks-RCU updates for v5.7 Paul E. McKenney
2020-02-15 0:25 ` [PATCH tip/core/rcu 1/3] rcu-tasks: *_ONCE() for rcu_tasks_cbs_head paulmck
2020-02-17 12:38 ` Peter Zijlstra
2020-02-17 18:16 ` Paul E. McKenney
2020-02-18 7:56 ` Peter Zijlstra [this message]
2020-02-18 16:27 ` Paul E. McKenney
2020-02-18 20:11 ` Peter Zijlstra
2020-02-18 20:22 ` Paul E. McKenney
2020-02-18 22:45 ` Steven Rostedt
2020-02-18 22:54 ` Paul E. McKenney
2020-02-18 23:13 ` Steven Rostedt
2020-02-18 23:54 ` Paul E. McKenney
2020-02-19 0:01 ` Joel Fernandes
2020-02-19 0:16 ` Paul E. McKenney
2020-02-19 1:13 ` Joel Fernandes
2020-02-19 1:48 ` Paul E. McKenney
2020-02-17 18:23 ` Joel Fernandes
2020-02-17 18:38 ` Marco Elver
2020-02-17 19:32 ` Joel Fernandes
2020-02-15 0:25 ` [PATCH tip/core/rcu 2/3] rcu: Add missing annotation for exit_tasks_rcu_start() paulmck
2020-02-17 14:44 ` Joel Fernandes
2020-02-17 23:10 ` Paul E. McKenney
2020-02-15 0:25 ` [PATCH tip/core/rcu 3/3] rcu: Add missing annotation for exit_tasks_rcu_finish() paulmck
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=20200218075648.GW14914@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=dipankar@in.ibm.com \
--cc=edumazet@google.com \
--cc=fweisbec@gmail.com \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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).