[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210706140337.GZ4397@paulmck-ThinkPad-P17-Gen-1>
Date: Tue, 6 Jul 2021 07:03:37 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Marco Elver <elver@...gle.com>, linux-kernel@...r.kernel.org
Subject: Re: RCU vs data_race()
On Tue, Jul 06, 2021 at 12:33:04PM +0200, Peter Zijlstra wrote:
> On Tue, Jul 06, 2021 at 10:44:46AM +0200, Marco Elver wrote:
> > On Tue, 6 Jul 2021 at 10:00, Peter Zijlstra <peterz@...radead.org> wrote:
> > [...]
> > > 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?
> >
> > KCSAN/KASAN report data-races/memory errors as soon as they encounter
> > them, but before they do, cannot give you any more than that (metadata
> > if it exists, but not sure it can be interpreted in any useful way
> > before an error occurs).
> >
> > But maybe I misunderstood. Is data_debug() meant to not return
> > anything and instead just be a "fake access"?
>
> Mostly just print any meta data that you might have. Like who allocated
> it, or which code touched it. I'm thinking KASAN/KCSAN need to keep
> track of such stuff for when a violation is detected.
>
> If I understand Paul right; and there's a fair chance I didn't; I tihnk
> the issue is that when RCU finds a double call_rcu() (or some other
> fail), it has very little clue how we got there, and any addition
> information might be useful.
If it is a current reference, we know that reference is relevant.
After all, if the structure is being passed to call_rcu(), then there
better not not be something else referencing it right now. But the
historical data you are (I think?) asking for might be completely
irrelevant due to its having happened too long ago.
Thanx, Paul
Powered by blists - more mailing lists