]> git.baikalelectronics.ru Git - kernel.git/commit
kcsan: test: Fix flaky test case
authorMarco Elver <elver@google.com>
Mon, 9 Aug 2021 11:25:11 +0000 (13:25 +0200)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 13 Sep 2021 23:41:19 +0000 (16:41 -0700)
commit07f5b8cd799b8d54d69583abad6ea2c8617b3f7e
treecf682459e524acd2803d907d4473e23ab6f57db5
parent9d3aaafd6b09220507021d83385468a241b80d63
kcsan: test: Fix flaky test case

If CONFIG_KCSAN_REPORT_VALUE_CHANGE_ONLY=n, then we may also see data
races between the writers only. If we get unlucky and never capture a
read-write data race, but only the write-write data races, then the
test_no_value_change* test cases may incorrectly fail.

The second problem is that the initial value needs to be reset, as
otherwise we might actually observe a value change at the start.

Fix it by also looking for the write-write data races, and resetting the
value to what will be written.

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