linux/kernel
zhidao su 3f27958b72 sched_ext: Use READ_ONCE() for plain reads of scx_watchdog_timeout
scx_watchdog_timeout is written with WRITE_ONCE() in scx_enable():

    WRITE_ONCE(scx_watchdog_timeout, timeout);

However, three read-side accesses use plain reads without the matching
READ_ONCE():

    /* check_rq_for_timeouts() - L2824 */
    last_runnable + scx_watchdog_timeout

    /* scx_watchdog_workfn() - L2852 */
    scx_watchdog_timeout / 2

    /* scx_enable() - L5179 */
    scx_watchdog_timeout / 2

The KCSAN documentation requires that if one accessor uses WRITE_ONCE()
to annotate lock-free access, all other accesses must also use the
appropriate accessor. Plain reads alongside WRITE_ONCE() leave the pair
incomplete and can trigger KCSAN warnings.

Note that scx_tick() already uses the correct READ_ONCE() annotation:

    last_check + READ_ONCE(scx_watchdog_timeout)

Fix the three remaining plain reads to match, making all accesses to
scx_watchdog_timeout consistently annotated and KCSAN-clean.

Signed-off-by: zhidao su <suzhidao@xiaomi.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2026-03-02 22:00:02 -10:00
..
bpf bpf: Switch to bpf_selem_unlink_nofail in bpf_local_storage_{map_free, destroy} 2026-02-06 14:47:59 -08:00
cgroup cgroup: Changes for v6.20 2026-02-11 13:20:50 -08:00
configs
debug
dma powerpc updates for 7.0 2026-02-10 21:46:12 -08:00
entry Merge branch 'core/entry' into sched/core 2026-01-30 15:40:05 +01:00
events Performance events changes for v7.0: 2026-02-10 12:00:46 -08:00
futex Futex changes for v6.19: 2025-12-10 17:21:30 +09:00
gcov
irq pci-v7.0-changes 2026-02-11 17:20:38 -08:00
kcsan kcsan: Enable context analysis 2026-01-05 16:43:35 +01:00
livepatch livepatch: Fix having __klp_objects relics in non-livepatch modules 2026-02-05 08:00:44 -08:00
liveupdate liveupdate: luo_file: do not clear serialized_data on unfreeze 2026-02-02 18:43:55 -08:00
locking test-ww_mutex: Allow test to be run (and re-run) from userland 2025-12-18 10:45:23 +01:00
module Modules changes for v7.0-rc1 2026-02-10 09:49:18 -08:00
power Merge branch 'pm-sleep' 2026-02-04 20:52:09 +01:00
printk Networking changes for 7.0 2026-02-11 19:31:52 -08:00
rcu Merge branch 'rcu-nocb.20260123a' 2026-01-23 11:15:36 -08:00
sched sched_ext: Use READ_ONCE() for plain reads of scx_watchdog_timeout 2026-03-02 22:00:02 -10:00
time Updates for the core time subsystem: 2026-02-10 16:41:59 -08:00
trace bpf-next-7.0 2026-02-10 11:26:21 -08:00
unwind unwind_user/fp: Use dummies instead of ifdef 2025-12-17 13:31:07 +01:00
.gitignore
Kconfig.freezer
Kconfig.hz
Kconfig.kexec
Kconfig.locks
Kconfig.preempt sched: Further restrict the preemption modes 2026-01-08 12:43:57 +01:00
Makefile kcov: Enable context analysis 2026-01-05 16:43:34 +01:00
acct.c simplify the callers of file_open_name() 2026-01-13 15:18:08 -05:00
async.c
audit.c audit: include source and destination ports to NETFILTER_PKT 2025-12-16 11:04:14 -05:00
audit.h
audit_fsnotify.c
audit_tree.c
audit_watch.c
auditfilter.c
auditsc.c struct filename ->refcnt doesn't need to be atomic 2026-01-13 15:18:07 -05:00
backtracetest.c
bounds.c x86/asm: Remove ANNOTATE_DATA_SPECIAL usage 2025-12-03 16:53:19 +01:00
capability.c
cfi.c
compat.c
configs.c
context_tracking.c context_tracking: Remove rcu_task_trace_heavyweight_{enter,exit}() 2026-01-01 16:39:46 +08:00
cpu.c cpu: Provide lockdep check for CPU hotplug lock write-held 2026-02-03 15:23:33 +01:00
cpu_pm.c
crash_core.c
crash_core_test.c
crash_dump_dm_crypt.c
crash_reserve.c
cred.c cred: remove unused set_security_override_from_ctx() 2026-01-06 20:52:57 -05:00
delayacct.c
dma.c
elfcorehdr.c
exec_domain.c
exit.c Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
exit.h
extable.c
fail_function.c
fork.c io_uring-bpf-restrictions.4-20260206 2026-02-09 17:31:17 -08:00
freezer.c
gen_kheaders.sh
groups.c
hung_task.c
iomem.c
irq_work.c
jump_label.c
kallsyms.c kallsyms: Get rid of kallsyms relative base 2026-01-22 15:58:22 -07:00
kallsyms_internal.h kallsyms: Get rid of kallsyms relative base 2026-01-22 15:58:22 -07:00
kallsyms_selftest.c
kallsyms_selftest.h
kcmp.c
kcov.c kcov: Use scoped init guard 2026-01-28 20:45:24 +01:00
kexec.c
kexec_core.c kernel/kexec: fix IMA when allocation happens in CMA area 2025-12-23 11:23:14 -08:00
kexec_elf.c
kexec_file.c
kexec_internal.h
kheaders.c
kprobes.c
kstack_erase.c
ksyms_common.c
ksysfs.c
kthread.c The kthread code provides an infrastructure which manages the preferred 2026-02-09 19:57:30 -08:00
latencytop.c
module_signature.c
notifier.c
nscommon.c
nsproxy.c
nstree.c
padata.c padata: Constify padata_sysfs_entry structs 2026-01-23 13:48:44 +08:00
panic.c panic: only warn about deprecated panic_print on write access 2026-01-19 12:30:01 -08:00
params.c params: Replace __modinit with __init_or_module 2025-12-22 16:35:53 +00:00
pid.c pid: only take pidmap_lock once on alloc 2025-12-15 14:33:38 +01:00
pid_namespace.c
pid_sysctl.h
profile.c
ptrace.c
range.c
reboot.c
regset.c
relay.c
resource.c resource: Increase MAX_IORES_LEVEL to 8 2026-01-27 16:36:51 -06:00
resource_kunit.c
rseq.c rseq: Lower default slice extension 2026-01-22 11:11:20 +01:00
scftorture.c
scs.c
seccomp.c
signal.c compiler-context-analysis: Remove __cond_lock() function-like helper 2026-01-05 16:43:33 +01:00
smp.c
smpboot.c
smpboot.h
softirq.c
stacktrace.c
static_call.c
static_call_inline.c
stop_machine.c
sys.c Updates for the VDSO subsystem: 2026-02-10 17:02:23 -08:00
sys_ni.c rseq: Implement sys_rseq_slice_yield() 2026-01-22 11:11:17 +01:00
sysctl-test.c
sysctl.c
task_work.c
taskstats.c
torture.c
tracepoint.c
tsacct.c
ucount.c
uid16.c
uid16.h
umh.c
up.c
user-return-notifier.c
user.c
user_namespace.c
utsname.c
utsname_sysctl.c
vhost_task.c
vmcore_info.c Kbuild/Kconfig updates for 7.0 2026-02-11 13:40:35 -08:00
watch_queue.c
watchdog.c powerpc/watchdog: add support for hardlockup_sys_info sysctl 2026-01-14 22:16:22 -08:00
watchdog_buddy.c
watchdog_perf.c
workqueue.c workqueue: Changes for v6.20 2026-02-11 13:13:32 -08:00
workqueue_internal.h