Skip to content

sched/deadline: dl_server fixes from 6.19

Florent Carli linux-rt-users stable 1 version Applied

Status from this message: Queued the series for 6.12, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/4sched/deadline: Fix dl_server time accountingkernel/sched/deadline.c kernel/sched/fair.c kernel/sched/idle.c +1 more+33 -350 replies
2/4sched/deadline: Fix dl_server stop conditioninclude/linux/sched.h kernel/sched/deadline.c+47 -80 replies
3/4sched: Provide idle_rq() helperinclude/linux/sched.h kernel/sched/sched.h kernel/sched/syscalls.c+29 -320 replies
4/4sched/deadline: Fix server stopping with runnable taskskernel/sched/deadline.c+9 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 6.12.y 0/4] sched/deadline: dl_server fixes from 6.19

Hello,

This is the 6.12.y backport of the dl_server fixes discussed in the parent thread: on 6.12.y, the deferred fair server can run a SCHED_OTHER task ahead of SCHED_FIFO tasks on an almost idle CPU. The same four commits are requested for 6.18.y, where they cherry-pick cleanly.

Adaptations for 6.12 (noted in each patch):

- 1/4: rq->donor does not exist in 6.12, rq->curr is used.
- 3/4: rq->ttwu_pending only exists with CONFIG_SMP in 6.12.
- 4/4: context conflict in dl_server_start(), which still initializes the fair server in 6.12.

2/4 applies as is. The series builds and boots on v6.12.118 with the Debian 6.12 rt config (PREEMPT_RT).

Tests, KVM guest, reproducer from the parent thread (3 ms spin), sleep 1.00, 1.02 and 1.03 s, 90 s per run, late = FIFO wake-up later than 500 us:

v6.12.118 8 late wake-ups in 270 s, ~2900 us
v6.12.118 + this series 0 in 270 s, max 15 us

With the v6.12-rt queue on top (as Debian ships it), which makes the window much easier to hit, an equivalent backport (same code, the idle_rq() helper added without moving available_idle_cpu()) went from 14 to 15 late wake-ups per 30 s to 0.

Starvation check (SCHED_OTHER task on the CPU of a SCHED_FIFO 50 busy loop, 4.5 s window): 4.9% of the CPU with this series, 4.7% without, 0% with the fair_server runtime at 0.

Thanks,
Florent

Gabriele Monaco (1):
sched/deadline: Fix server stopping with runnable tasks

Peter Zijlstra (3):
sched/deadline: Fix dl_server time accounting
sched/deadline: Fix dl_server stop condition
sched: Provide idle_rq() helper

 include/linux/sched.h   | 16 ++++----
 kernel/sched/deadline.c | 89 +++++++++++++++++++++++++++--------------
 kernel/sched/fair.c     |  9 +----
 kernel/sched/idle.c     | 16 +++++++-
 kernel/sched/sched.h    | 31 +++++++++++++-
 kernel/sched/syscalls.c | 32 +--------------
 6 files changed, 116 insertions(+), 77 deletions(-)

base-commit: b869a5313cbfe7102873d3de318ddb68675146d0

Signature · 1 line
2.39.3 (Apple Git-146)