]> git.ipfire.org Git - thirdparty/linux.git/commit
sched_ext: Expose exit_cpu to BPF and userspace
authorChangwoo Min <changwoo@igalia.com>
Wed, 29 Apr 2026 08:23:18 +0000 (17:23 +0900)
committerTejun Heo <tj@kernel.org>
Wed, 29 Apr 2026 08:44:34 +0000 (22:44 -1000)
commitee8391ba11644fd3dce6e22ece54725a1bb5b50e
tree2b0b0379bbe3ccf918883b56b8e907c4fa17ff88
parent78683079ca6d91392e84ed313e15bb330d7da851
sched_ext: Expose exit_cpu to BPF and userspace

Extend struct user_exit_info with an exit_cpu field so BPF schedulers
and the userspace report path can see the CPU that triggered the exit,
matching the kernel-side dump.

UEI_RECORD() defaults the field to -1 before the CO-RE-gated copy so
that running against an older kernel without exit_cpu stays
distinguishable from "exit happened on CPU 0".

UEI_REPORT() appends "on CPU N" to the EXIT line when the value is
valid, surfacing the most diagnostically useful piece of exit info to
any sched_ext userspace tool without needing to crack open the debug
dump.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/sched_ext/include/scx/user_exit_info.bpf.h
tools/sched_ext/include/scx/user_exit_info.h
tools/sched_ext/include/scx/user_exit_info_common.h