[PATCHSET sched_ext/for-7.3] sched_ext: Sparse annotation cleanups
From: Tejun Heo
Date: Thu Jul 23 2026 - 21:30:35 EST
Hello,
A sparse sweep of kernel/sched/ext flagged the __rcu pointers that are
read with plain loads. The reads are all protected by their calling
contexts but didn't state how. Add accessors that encode the protection
and convert the readers:
- cgrp->scx_sched readers go through the new scx_cgroup_sched() which
states the locks that stabilize the association (0001).
- The naked scx_root accesses are resolved through the sched at hand or
through new accessors that state the protection. One transitional
marker remains (0002).
- The dsq->first_task identity comparison uses rcu_access_pointer()
(0003).
What remains in the sparse output on kernel/sched/ext is the BPF kfunc
declaration noise shared with the rest of the tree, the rq->curr and
rq->donor accesses shared with the core scheduler, and the deliberately
naked scx_root access in touch_core_sched_dispatch() to be resolved
separately.
Based on sched_ext/for-7.3 (94ca9591108a).
Tejun Heo (3):
sched_ext: Add scx_cgroup_sched() for cgrp->scx_sched reads
sched_ext: Resolve most remaining scx_root accesses
sched_ext: Use rcu_access_pointer() for the first_task comparison
Git tree: git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git scx-sparse-cleanups
kernel/sched/ext/ext.c | 20 ++++++++++----------
kernel/sched/ext/idle.c | 15 +++++++--------
kernel/sched/ext/internal.h | 27 +++++++++++++++++++++++++++
kernel/sched/ext/sub.c | 33 +++++++++++++++++++--------------
kernel/sched/ext/sub.h | 14 ++++++++++++++
5 files changed, 77 insertions(+), 32 deletions(-)
--
tejun