sched_ext: Report NMI kicks with scx_error()

The per-cpu kick lists are protected by IRQ masking which doesn't stop NMIs,
so scx_bpf_kick_cpu() from NMI silently drops the kick after a one-time
warning. A dropped kick can leave a CPU idle when the scheduler believes it
was woken, which is a correctness problem for the scheduler even if the
kernel is fine. Now that scx_error() works from NMI, abort the scheduler
instead so that the bug is surfaced deterministically. The warned_nmi_kick
tracking is no longer needed.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
This commit is contained in:
Tejun Heo
2026-07-27 11:20:32 -10:00
parent 1bf623ebd5
commit e06ece82d7
2 changed files with 1 additions and 6 deletions
+1 -5
View File
@@ -9219,11 +9219,7 @@ void scx_kick_cpu(struct scx_sched *sch, s32 cpu, u64 flags)
* not mask NMIs, so kicking from NMI could corrupt it and is unsupported.
*/
if (unlikely(in_nmi())) {
if (!sch->warned_nmi_kick) {
sch->warned_nmi_kick = true;
pr_warn("sched_ext: %s: scx_bpf_kick_cpu() from NMI ignored\n",
sch->ops.name);
}
scx_error(sch, "scx_bpf_kick_cpu() called from NMI");
return;
}
-1
View File
@@ -1543,7 +1543,6 @@ struct scx_sched {
*/
bool warned_zero_slice:1;
bool warned_unassoc_progs:1;
bool warned_nmi_kick:1;
struct list_head all;