History

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.

Tejun Heo committed 3 months ago

Commit e06ece81 parent 1bf623e2 files · +1 −6Browse files

Unified · Split

2 files
  1. kernel/sched/ext/ext.c +1 −5
  2. kernel/sched/ext/internal.h +0 −1
kernel/sched/ext/ext.c+1−5
@@ -9219,11 +9219,7 @@ void scx_kick_cpu(struct scx_sched *sch, s32 cpu, u64 flags) · 9218 unmodified lines
92199219 * not mask NMIs, so kicking from NMI could corrupt it and is unsupported.
92209220 */
92219221 if (unlikely(in_nmi())) {
9222− if (!sch->warned_nmi_kick) {
9223− sch->warned_nmi_kick = true;
9224− pr_warn("sched_ext: %s: scx_bpf_kick_cpu() from NMI ignored\n",
9225− sch->ops.name);
9226− }
9222+ scx_error(sch, "scx_bpf_kick_cpu() called from NMI");
92279223 return;
92289224 }
92299225
kernel/sched/ext/internal.h+0−1
@@ -1543,7 +1543,6 @@ struct scx_sched { · 1542 unmodified lines
15431543 */
15441544 bool warned_zero_slice:1;
15451545 bool warned_unassoc_progs:1;
1546− bool warned_nmi_kick:1;
15471546
15481547 struct list_head all;
15491548

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t