From: Peter Zijlstra <peterz@infradead.org>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Marco Elver <elver@google.com>, linux-kernel@vger.kernel.org
Subject: Re: RCU vs data_race()
Date: Tue, 6 Jul 2021 10:00:02 +0200 [thread overview]
Message-ID: <YOQNgsS9Tjt4aDmG@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20210621133757.GS4397@paulmck-ThinkPad-P17-Gen-1>
Sorry for the late reply, thread got snowed under :/
On Mon, Jun 21, 2021 at 06:37:57AM -0700, Paul E. McKenney wrote:
> On Mon, Jun 21, 2021 at 09:28:02AM +0200, Peter Zijlstra wrote:
> > On Sun, Jun 20, 2021 at 02:01:27PM -0700, Paul E. McKenney wrote:
> > > On Sun, Jun 20, 2021 at 09:14:28PM +0200, Peter Zijlstra wrote:
> >
> > > > I don't buy that argument. pr_err() (or worse) is not supposed to
> > > > happen, ever. If it does, *that* is a far worse condition that any data
> > > > race possibly found by kcsan.
> > > >
> > > > So the only way the pr_err() expression itself can lead to kcsan
> > > > determining a data-race, if something far worse triggered the pr_err()
> > > > itself.
> > >
> > > Earlier, you said pr_warn(). Above, I said pr_*(). Now you say
> > > pr_err(). But OK...
> >
> > Same, thing.. also Sundays aren't great for details it seems :-)
>
> I know that feeling! ;-)
>
> > > Let's take for example the pr_err() in __call_rcu(), that is, the
> > > double-free diagnostic. A KCSAN warning on the unmarked load from
> > > head->func could give valuable information on the whereabouts of the
> > > other code interfering with the callback. Blanket disabling of KCSAN
> > > across all pr_err() calls (let alone all pr_*() calls) would be the
> > > opposite of helpful.
> >
> > I'm confused. That pr_err() should never happen in a correct program. If
> > it happens, fix it and any data race as a consequence of that pr_err()
> > no longer exists either.
> >
> > I fundementally don't see the relevance of a possible data race from a
> > statement that should never happen in a correct program to begin with.
> >
> > Why do you think otherwise?
>
> Because detection of that data race can provide valuable debugging help.
In that case, would not an explicit: data_debug(addr) call (implemented
by KASAN/KCSAN/whoever), which would report whatever knowledge they have
about that address, be even more useful?
Then you don't need to hope that there's a data race of sorts in order
to obtain said information.
That is; if you want information, explicitly asking for it seems *much*
better than hoping.
next prev parent reply other threads:[~2021-07-06 8:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-18 8:24 Peter Zijlstra
2021-06-18 8:59 ` Marco Elver
2021-06-18 11:26 ` Peter Zijlstra
2021-06-18 20:48 ` Paul E. McKenney
2021-06-20 19:14 ` Peter Zijlstra
2021-06-20 21:01 ` Paul E. McKenney
2021-06-21 7:28 ` Peter Zijlstra
2021-06-21 13:37 ` Paul E. McKenney
2021-07-06 8:00 ` Peter Zijlstra [this message]
2021-07-06 8:44 ` Marco Elver
2021-07-06 10:33 ` Peter Zijlstra
2021-07-06 14:03 ` Paul E. McKenney
2021-07-06 8:37 ` Peter Zijlstra
2021-07-06 14:16 ` Paul E. McKenney
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=YOQNgsS9Tjt4aDmG@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=elver@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.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®