]> git.ipfire.org Git - thirdparty/linux.git/commit
sched_ext: Introduce scx_bpf_cpu_curr()
authorChristian Loehle <christian.loehle@arm.com>
Wed, 3 Sep 2025 21:23:10 +0000 (22:23 +0100)
committerTejun Heo <tj@kernel.org>
Wed, 3 Sep 2025 21:50:42 +0000 (11:50 -1000)
commit20b158094a1adc9bbfdcc41780059b5cd8866ad8
tree201ca03b9e522392ad624488d33496b1a22b61cb
parente0ca169638be12a0a861e3439e6117c58972cd08
sched_ext: Introduce scx_bpf_cpu_curr()

Provide scx_bpf_cpu_curr() as a way for scx schedulers to check the curr
task of a remote rq without assuming its lock is held.

Many scx schedulers make use of scx_bpf_cpu_rq() to check a remote curr
(e.g. to see if it should be preempted). This is problematic because
scx_bpf_cpu_rq() provides access to all fields of struct rq, most of
which aren't safe to use without holding the associated rq lock.

Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Acked-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/sched/ext.c
tools/sched_ext/include/scx/common.bpf.h