]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit42445e58d302eef7d066adf185a00efbf4c0c282
tree3cc0c8938304bb29992524788e001270d1afb4ca
parent45e14e0c5c02d5afb33a25632dc2a6e32386b21d
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