[PATCH 0/2] sched/deadline: Fix forced idle charged when a sibling ends it

From: Fernand Sieber

Date: Tue Nov 24 2026 - 04:40:58 EST


Karl reported that "sched/deadline: Don't charge core-sched forced idle
to the DL servers" (f4626e1c3c14, in sched/urgent) still charges forced
idle to the DL servers when the sibling's cookied task blocks: the core
pick clears core_forceidle_count before the idle CPU charges the time.
With his 800 us spin / 10 us sleep FIFO pattern the CFS task gets
0.8-1.8% instead of its 5% reservation.

Patch 1 makes the core-wide pick charge each idle sibling's idle time
under the forced-idle state from before the pick, so that no charged
span crosses a change of that state. It adds no new state. Patch 2 adds
Karl's pattern to cs_dl_server_test.

Tested on sched/core. QEMU, 2 cores x 2 threads, 8 runs each:
tip/sched/core fails Karl's pattern 8/8; with these patches both tests
pass 8/8 (5.0% and 5.6-5.8%). Both patches apply to sched/urgent, where
the existing selftest already needs 87a825f3c680 ("sched/core: Rank DL
server picks as deadline in the core-wide pick"), as in my earlier mail.

This series was prepared with the help of an AI coding assistant. I have
reviewed and tested all of it.

Fernand Sieber (2):
sched/deadline: Keep forced idle uncharged when a sibling ends it
selftests/sched: Let the FIFO task block in cs_dl_server_test

kernel/sched/core.c | 8 ++
kernel/sched/idle.c | 25 +++-
kernel/sched/sched.h | 1 +
.../selftests/sched/cs_dl_server_test.c | 107 +++++++++++-------
4 files changed, 96 insertions(+), 45 deletions(-)




Amazon Development Centre (South Africa) (Proprietary) Limited
29 Gogosoa Street, Observatory, Cape Town, Western Cape, 7925, South Africa
Registration Number: 2004 / 034463 / 07