[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200121144716.GQ14879@hirez.programming.kicks-ass.net>
Date: Tue, 21 Jan 2020 15:47:16 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: "Paul E. McKenney" <paulmck@...nel.org>
Cc: Marco Elver <elver@...gle.com>, andreyknvl@...gle.com,
glider@...gle.com, dvyukov@...gle.com, kasan-dev@...glegroups.com,
linux-kernel@...r.kernel.org, mark.rutland@....com,
will@...nel.org, boqun.feng@...il.com, arnd@...db.de,
viro@...iv.linux.org.uk, christophe.leroy@....fr, dja@...ens.net,
mpe@...erman.id.au, rostedt@...dmis.org, mhiramat@...nel.org,
mingo@...nel.org, christian.brauner@...ntu.com,
daniel@...earbox.net, cyphar@...har.com, keescook@...omium.org,
linux-arch@...r.kernel.org
Subject: Re: [PATCH 3/5] asm-generic, kcsan: Add KCSAN instrumentation for
bitops
On Tue, Jan 21, 2020 at 06:21:09AM -0800, Paul E. McKenney wrote:
> On Tue, Jan 21, 2020 at 10:15:01AM +0100, Peter Zijlstra wrote:
> > On Mon, Jan 20, 2020 at 12:23:59PM -0800, Paul E. McKenney wrote:
> > > We also don't have __atomic_read() and __atomic_set(), yet atomic_read()
> > > and atomic_set() are considered to be non-racy, right?
> >
> > What is racy? :-) You can make data races with atomic_{read,set}() just
> > fine.
>
> Like "fairness", lots of definitions of "racy". ;-)
>
> > Anyway, traditionally we call the read-modify-write stuff atomic, not
> > the trivial load-store stuff. The only reason we care about the
> > load-store stuff in the first place is because C compilers are shit.
> >
> > atomic_read() / test_bit() are just a load, all we need is the C
> > compiler not to be an ass and split it. Yes, we've invented the term
> > single-copy atomicity for that, but that doesn't make it more or less of
> > a load.
> >
> > And exactly because it is just a load, there is no __test_bit(), which
> > would be the exact same load.
>
> Very good! Shouldn't KCSAN then define test_bit() as non-racy just as
> for atomic_read()?
Sure it does; but my comment was aimed at the gripe that test_bit()
lives in the non-atomic bitops header. That is arguably entirely
correct.
Powered by blists - more mailing lists