Thank Marco for giving me such valuable advice. Both RCU and KCSAN are very attractive and amazing to me, I have carefully read your advice and will strive to acquire expertise in the following days. Thanks again Zhouyi On Wed, Dec 15, 2021 at 12:57 AM Marco Elver <elver@xxxxxxxxxx> wrote: > > On Tue, 14 Dec 2021 at 09:38, Zhouyi Zhou <zhouzhouyi@xxxxxxxxx> wrote: > [...] > > 2) The KCSAN kernel compile with clang-12: > > CONFIG_HAVE_ARCH_KCSAN=y > > CONFIG_HAVE_KCSAN_COMPILER=y > > CONFIG_KCSAN=y > > CONFIG_KCSAN_SELFTEST=y > > # CONFIG_KCSAN_EARLY_ENABLE is not set > > CONFIG_KCSAN_NUM_WATCHPOINTS=64 > > CONFIG_KCSAN_UDELAY_TASK=80 > > CONFIG_KCSAN_UDELAY_INTERRUPT=20 > > CONFIG_KCSAN_DELAY_RANDOMIZE=y > > CONFIG_KCSAN_SKIP_WATCH=4000 > > CONFIG_KCSAN_SKIP_WATCH_RANDOMIZE=y > > # CONFIG_KCSAN_INTERRUPT_WATCHER is not set > > CONFIG_KCSAN_REPORT_ONCE_IN_MS=3000 > > # CONFIG_KCSAN_REPORT_RACE_UNKNOWN_ORIGIN is not set > > # CONFIG_KCSAN_STRICT is not set > > CONFIG_KCSAN_REPORT_VALUE_CHANGE_ONLY=y > > # CONFIG_KCSAN_ASSUME_PLAIN_WRITES_ATOMIC is not set > > CONFIG_KCSAN_IGNORE_ATOMICS=y > > CONFIG_KCSAN_PERMISSIVE=y > > Note, rcutorture selects CONFIG_KCSAN_STRICT=y, which may be one part > of the issue. The other is that the -rcu tree has KCSAN enhancements > not yet available in mainline, which are enabled together with > CONFIG_KCSAN_STRICT, and make KCSAN slightly more aggressive (i.e. > finds data races faster) as well. Although you can also locally make > KCSAN a bit more aggressive by lowering CONFIG_KCSAN_SKIP_WATCH (boot > param kcsan.skip_watch=), to e.g. 2000-3000, but too low and you'll > hurt forward-progress. > > -- Marco