sched_ext: Reset runnable_at when a task leaves its scheduler
Status from this message: Applied to sched_ext/for-7.4-fixes with the following tags added:
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | sched_ext: Reset runnable_at when a task leaves its schedulerkernel/ | +13 | 2 replies | |
| 2/2 | selftests/sched_ext: Add class_switch_stall testtools/ tools/ tools/ | +362 | 1 reply |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Andrea Righi |
|---|---|
| 1/2 | R-b R-b |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] sched_ext: Reset runnable_at when a task leaves its scheduler
A task that is switched out of SCHED_EXT while it's waiting keeps its p->scx.runnable_at. When it comes back, the watchdog counts the time it spent in another class as waiting, and can abort the scheduler for a stall that didn't happen. Patch 1 restarts the wait when a task leaves its scheduler. Patch 2 adds a selftest that reproduces the spurious stall.
The bug goes back to the watchdog's introduction in v6.12. The series is based on sched_ext/for-7.4, and patch 1 also applies to for-7.3-fixes.
Tested in a virtme-ng VM (16 CPUs, PROVE_LOCKING): class_switch_stall fails every time without patch 1 and passes with it. The other sched_ext selftests give the same results with and without the series (enq_blocked fails in this VM either way).
I used an AI coding assistant to find the bug and to write and test both patches.
Michal Blaszczyk (2):
sched_ext: Reset runnable_at when a task leaves its scheduler selftests/sched_ext: Add class_switch_stall test
kernel/sched/ext/ext.c | 14 +- tools/testing/selftests/sched_ext/Makefile | 1 + .../sched_ext/class_switch_stall.bpf.c | 121 +++++++++ .../selftests/sched_ext/class_switch_stall.c | 240 ++++++++++++++++++ 4 files changed, 375 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/sched_ext/class_switch_stall.bpf.c create mode 100644 tools/testing/selftests/sched_ext/class_switch_stall.c
base-commit: 1f5dde349ac2fca1f119ae8de3f0d2f1c2a8d338
Signature · 1 line
2.56.0.176.g3575e65682-goog