kernel_optimize_test/kernel/kcsan
Marco Elver 106a307fd0 kcsan: Skew delay to be longer for certain access types
For compound instrumentation and assert accesses, skew the watchpoint
delay to be longer if randomized. This is useful to improve race
detection for such accesses.

For compound accesses we should increase the delay as we've aggregated
both read and write instrumentation. By giving up 1 call into the
runtime, we're less likely to set up a watchpoint and thus less likely
to detect a race. We can balance this by increasing the watchpoint
delay.

For assert accesses, we know these are of increased interest, and we
wish to increase our chances of detecting races for such checks.

Note that, kcsan_udelay_{task,interrupt} define the upper bound delays.
When randomized, delays are uniformly distributed between [0, delay].
Skewing the delay does not break this promise as long as the defined
upper bounds are still adhered to. The current skew results in delays
uniformly distributed between [delay/2, delay].

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-08-24 15:09:57 -07:00
..
atomic.h kcsan: Remove existing special atomic rules 2020-06-29 12:04:48 -07:00
core.c kcsan: Skew delay to be longer for certain access types 2020-08-24 15:09:57 -07:00
debugfs.c kcsan: Use GFP_ATOMIC under spin lock 2020-04-27 11:10:10 -07:00
encoding.h kcsan: Prefer __always_inline for fast-path 2020-03-21 09:40:19 +01:00
kcsan-test.c kcsan: Add atomic builtin test case 2020-08-24 15:09:31 -07:00
kcsan.h kcsan: Improve IRQ state trace reporting 2020-07-31 12:12:03 +02:00
Makefile kcsan: Disable branch tracing in core runtime 2020-06-29 12:04:48 -07:00
report.c kcsan: Support compounded read-write instrumentation 2020-08-24 15:09:32 -07:00
selftest.c kcsan: Rename test.c to selftest.c 2020-06-29 12:04:48 -07:00