]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sched_ext: Dump the exit CPU first
authorChangwoo Min <changwoo@igalia.com>
Wed, 29 Apr 2026 08:23:17 +0000 (17:23 +0900)
committerTejun Heo <tj@kernel.org>
Wed, 29 Apr 2026 08:44:23 +0000 (22:44 -1000)
commit78683079ca6d91392e84ed313e15bb330d7da851
tree81e320096eb59d321cbd8678ee87a2f51a718b02
parent3f63ddda0b969410585757309cc95add4f256f45
sched_ext: Dump the exit CPU first

When sched_ext is disabled by an error, the CPU that triggered the exit
is the most relevant piece of information for diagnosing the problem.
However, if there are many CPUs, the dump can get truncated and that
CPU's information may not appear in the output.

Add an exit_cpu field to scx_exit_info and thread it through scx_vexit()
/ __scx_exit(). For the watchdog stall path, populate it from cpu_of(rq)
in check_rq_for_timeouts(). For all other exit paths, define a scx_exit()
macro that wraps __scx_exit() with raw_smp_processor_id(), so the CPU
that initiated the exit is captured automatically, with no call-site
changes needed.

In scx_dump_state(), report the exit CPU in the dump header ("on cpu N")
and dump that CPU first, skipping it in the per-CPU loop, so the most
relevant CPU is never truncated out of the dump. The SysRq-D path
initializes exit_cpu to -1 so debug dumps not tied to an exit don't
arbitrarily promote CPU 0.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/sched/ext.c
kernel/sched/ext_internal.h