Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Florent Carli <fcarli@gmail.com>
To: stable@vger.kernel.org
Cc: Juri Lelli <juri.lelli@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Gabriele Monaco <gmonaco@redhat.com>,
	linux-rt-users@vger.kernel.org
Subject: [PATCH 6.12.y 0/4] sched/deadline: dl_server fixes from 6.19
Date: Fri, 20 Nov 2026 19:19:45 +0100	[thread overview]
Message-ID: <20261120181949.7528-1-fcarli@gmail.com> (raw)
In-Reply-To: <awB-5usPb2QZXt37@jlelli-thinkpadt14gen4.remote.csb>

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
-- 
2.39.3 (Apple Git-146)


  parent reply	other threads:[~2026-11-20 18:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 15:09 [REGRESSION] 6.12.y, 6.18.y: fair server runs SCHED_OTHER ahead of SCHED_FIFO on an idle CPU (fixed in 6.19) Florent Carli
2026-11-20 17:09 ` Juri Lelli
2026-11-20 18:19   ` Florent Carli
2026-11-21 15:27     ` Sasha Levin
2026-11-20 18:19   ` Florent Carli [this message]
2026-11-20 18:19     ` [PATCH 6.12.y 1/4] sched/deadline: Fix dl_server time accounting Florent Carli
2026-11-20 18:19     ` [PATCH 6.12.y 2/4] sched/deadline: Fix dl_server stop condition Florent Carli
2026-11-20 18:19     ` [PATCH 6.12.y 3/4] sched: Provide idle_rq() helper Florent Carli
2026-11-20 18:19     ` [PATCH 6.12.y 4/4] sched/deadline: Fix server stopping with runnable tasks Florent Carli
2026-11-21 15:27     ` [PATCH 6.12.y 0/4] sched/deadline: dl_server fixes from 6.19 Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261120181949.7528-1-fcarli@gmail.com \
    --to=fcarli@gmail.com \
    --cc=gmonaco@redhat.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox