kcsan: Add current->state to implicitly atomic accesses
authorMarco Elver <elver@google.com>
Tue, 25 Feb 2020 14:32:58 +0000 (15:32 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 25 Mar 2020 16:56:00 +0000 (09:56 -0700)
commit44656d3dc4f0dc20010d054f27397a4a1469fabf
tree3cc0c8938304bb29992524788e001270d1afb4ca
parent2402d0eae589a31ee7b1774cb220d84d0f5605b4
kcsan: Add current->state to implicitly atomic accesses

Add volatile current->state to list of implicitly atomic accesses. This
is in preparation to eventually enable KCSAN on kernel/sched (which
currently still has KCSAN_SANITIZE := n).

Since accesses that match the special check in atomic.h are rare, it
makes more sense to move this check to the slow-path, avoiding the
additional compare in the fast-path. With the microbenchmark, a speedup
of ~6% is measured.

Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/kcsan/atomic.h
kernel/kcsan/core.c
kernel/kcsan/debugfs.c