diff options
author | Marco Elver <elver@google.com> | 2020-03-25 17:41:58 +0100 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2020-04-13 17:18:13 -0700 |
commit | d8949ef1d9f1062848cd068cf369a57ce33dae6f (patch) | |
tree | 1f24321c498bf83bc5784d0fe5694737838f961d /Documentation | |
parent | 9967683ce5d4ce21829bbc807e006ee33cc68725 (diff) | |
download | linux-d8949ef1d9f1062848cd068cf369a57ce33dae6f.tar.gz linux-d8949ef1d9f1062848cd068cf369a57ce33dae6f.tar.bz2 linux-d8949ef1d9f1062848cd068cf369a57ce33dae6f.zip |
kcsan: Introduce scoped ASSERT_EXCLUSIVE macros
Introduce ASSERT_EXCLUSIVE_*_SCOPED(), which provide an intuitive
interface to use the scoped-access feature, without having to explicitly
mark the start and end of the desired scope. Basing duration of the
checks on scope avoids accidental misuse and resulting false positives,
which may be hard to debug. See added comments for usage.
The macros are implemented using __attribute__((__cleanup__(func))),
which is supported by all compilers that currently support KCSAN.
Suggested-by: Boqun Feng <boqun.feng@gmail.com>
Suggested-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/dev-tools/kcsan.rst | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Documentation/dev-tools/kcsan.rst b/Documentation/dev-tools/kcsan.rst index 52a5d6fb9701..f4b5766f12cc 100644 --- a/Documentation/dev-tools/kcsan.rst +++ b/Documentation/dev-tools/kcsan.rst @@ -238,7 +238,8 @@ are defined at the C-language level. The following macros can be used to check properties of concurrent code where bugs would not manifest as data races. .. kernel-doc:: include/linux/kcsan-checks.h - :functions: ASSERT_EXCLUSIVE_WRITER ASSERT_EXCLUSIVE_ACCESS + :functions: ASSERT_EXCLUSIVE_WRITER ASSERT_EXCLUSIVE_WRITER_SCOPED + ASSERT_EXCLUSIVE_ACCESS ASSERT_EXCLUSIVE_ACCESS_SCOPED ASSERT_EXCLUSIVE_BITS Implementation Details |