linux/Documentation/dev-tools
Marco Elver 31f605a308 kcsan, compiler_types: Introduce __data_racy type qualifier
Based on the discussion at [1], it would be helpful to mark certain
variables as explicitly "data racy", which would result in KCSAN not
reporting data races involving any accesses on such variables. To do
that, introduce the __data_racy type qualifier:

	struct foo {
		...
		int __data_racy bar;
		...
	};

In KCSAN-kernels, __data_racy turns into volatile, which KCSAN already
treats specially by considering them "marked". In non-KCSAN kernels the
type qualifier turns into no-op.

The generated code between KCSAN-instrumented kernels and non-KCSAN
kernels is already huge (inserted calls into runtime for every memory
access), so the extra generated code (if any) due to volatile for few
such __data_racy variables are unlikely to have measurable impact on
performance.

Link: https://lore.kernel.org/all/CAHk-=wi3iondeh_9V2g3Qz5oHTRjLsOpoy83hb58MVh=nRZe0A@mail.gmail.com/ [1]
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Marco Elver <elver@google.com>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2024-05-07 11:39:50 -07:00
..
kunit Documentation: KUnit: Update the instructions on how to test static functions 2024-01-22 07:59:03 -07:00
checkpatch.rst docs: dev-tools: checkpatch.rst: Fix grammar 2024-02-12 16:42:13 -07:00
checkuapi.rst docs: dev-tools: Add UAPI checker documentation 2023-12-29 22:25:21 +09:00
coccinelle.rst Documentation: coccinelle: Escape --options to fix Sphinx output 2023-01-31 13:55:44 -07:00
gcov.rst docs/gcov: Convert two tags to ref in dev-tools/gov.rst 2021-04-08 11:19:43 -06:00
gdb-kernel-debugging.rst docs/scripts/gdb: add necessary make scripts_gdb step 2023-01-26 11:21:05 -07:00
index.rst Kbuild updates for v6.8 2024-01-18 17:57:07 -08:00
kasan.rst - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
kcov.rst kcov: improve documentation 2023-04-08 13:45:36 -07:00
kcsan.rst kcsan, compiler_types: Introduce __data_racy type qualifier 2024-05-07 11:39:50 -07:00
kfence.rst kfence: allow use of a deferrable timer 2022-03-22 15:57:11 -07:00
kgdb.rst Documentation: kgdb: Replace deprecated remotebaud 2022-01-07 09:33:13 -07:00
kmemleak.rst docs: kmemleak: adjust to config renaming 2023-04-20 17:53:38 -06:00
kmsan.rst Documentation: *san: drop "the" from article titles 2023-10-18 14:34:15 -07:00
kselftest.rst Networking changes for 6.9. 2024-03-12 17:44:08 -07:00
ktap.rst Documentation: dev-tools: Clarify requirements for result description 2022-12-12 14:13:48 -07:00
sparse.rst Documentation/sparse: add hints about __CHECKER__ 2022-03-23 19:00:33 -07:00
testing-overview.rst Documentation: dev-tools: Enhance static analysis section with discussion 2022-04-05 09:48:25 -06:00
ubsan.rst ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL 2024-02-06 02:21:38 -08:00