kcsan: Reduce get_ctx() uses in kcsan_found_watchpoint()
authorMarco Elver <elver@google.com>
Mon, 7 Jun 2021 12:56:50 +0000 (14:56 +0200)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 20 Jul 2021 20:49:43 +0000 (13:49 -0700)
commit08cac6049412061e571fadadc3e23464dc46d0f2
tree8ca18f66e25e65833db18c6b3425f6d4b8daa677
parente675d2533a74acfa95c62e7bb088335866f44fd2
kcsan: Reduce get_ctx() uses in kcsan_found_watchpoint()

There are a number get_ctx() calls that are close to each other, which
results in poor codegen (repeated preempt_count loads).

Specifically in kcsan_found_watchpoint() (even though it's a slow-path)
it is beneficial to keep the race-window small until the watchpoint has
actually been consumed to avoid missed opportunities to report a race.

Let's clean it up a bit before we add more code in
kcsan_found_watchpoint().

Signed-off-by: Marco Elver <elver@google.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/kcsan/core.c