[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201217145955.GP2657@paulmck-ThinkPad-P72>
Date: Thu, 17 Dec 2020 06:59:55 -0800
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Marco Elver <elver@...gle.com>,
LKML <linux-kernel@...r.kernel.org>,
kasan-dev <kasan-dev@...glegroups.com>,
Ingo Molnar <mingo@...nel.org>,
Frederic Weisbecker <frederic@...nel.org>,
Will Deacon <will@...nel.org>,
Naresh Kamboju <naresh.kamboju@...aro.org>,
syzbot+23a256029191772c2f02@...kaller.appspotmail.com,
syzbot+56078ac0b9071335a745@...kaller.appspotmail.com,
syzbot+867130cb240c41f15164@...kaller.appspotmail.com
Subject: Re: [patch 3/3] tick: Annotate tick_do_timer_cpu data races
On Thu, Dec 17, 2020 at 11:48:23AM +0100, Peter Zijlstra wrote:
> On Wed, Dec 16, 2020 at 01:19:31PM -0800, Paul E. McKenney wrote:
> > Given that there is no optimization potential, then the main reason to use
> > data_race() instead of *_ONCE() is to prevent KCSAN from considering the
> > accesses when looking for data races. But that is mostly for debugging
> > accesses, in cases when these accesses are not really part of the
> > concurrent algorithm.
> >
> > So if I understand the situation correctly, I would be using *ONCE().
>
> Huh, what, why?
>
> The code doesn't need READ_ONCE(), it merely wants to tell kasan that
> the race it observes is fine and as to please shut up.
>
> IOW data_race() is accurate and right.
Other way around.
The code does not need any of the compiler optimizations that might
someday be enabled by data_race(). So why do you need data_race() here?
What do exactly is lost by instead using READ_ONCE()?
Thanx, Paul
Powered by blists - more mailing lists