From: Marco Elver Date: Tue, 30 Nov 2021 11:44:29 +0000 (+0100) Subject: sched, kcsan: Enable memory barrier instrumentation X-Git-Tag: v6.6.17~8479^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f3f0c98b5665f437a631882653b5baf7dd98448;p=platform%2Fkernel%2Flinux-rpi.git sched, kcsan: Enable memory barrier instrumentation There's no fundamental reason to disable KCSAN for scheduler code, except for excessive noise and performance concerns (instrumenting scheduler code is usually a good way to stress test KCSAN itself). However, several core sched functions imply memory barriers that are invisible to KCSAN without instrumentation, but are required to avoid false positives. Therefore, unconditionally enable instrumentation of memory barriers in scheduler code. Also update the comment to reflect this and be a bit more brief. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney --- diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile index c7421f2..c83b37af 100644 --- a/kernel/sched/Makefile +++ b/kernel/sched/Makefile @@ -11,11 +11,10 @@ ccflags-y += $(call cc-disable-warning, unused-but-set-variable) # that is not a function of syscall inputs. E.g. involuntary context switches. KCOV_INSTRUMENT := n -# There are numerous data races here, however, most of them are due to plain accesses. -# This would make it even harder for syzbot to find reproducers, because these -# bugs trigger without specific input. Disable by default, but should re-enable -# eventually. +# Disable KCSAN to avoid excessive noise and performance degradation. To avoid +# false positives ensure barriers implied by sched functions are instrumented. KCSAN_SANITIZE := n +KCSAN_INSTRUMENT_BARRIERS := y ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y) # According to Alan Modra , the -fno-omit-frame-pointer is