The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>
Cc: linux-rt-devel@lists.linux.dev, tj@kernel.org,
	hannes@cmpxchg.org, mkoutny@suse.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v14 02/39] sched/deadline: Replenish a throttled task boosted while asleep
Date: Thu, 03 Dec 2026 15:29:01 +0000	[thread overview]
Message-ID: <sashiko-outbox-248109@kernel.org> (raw)
In-Reply-To: <820b6a522c53eef14d41b0893f72e090ad8da92e.1796296313.git.mathieu.desnoyers@efficios.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] sched/deadline: Fixes trailer cites feff2e65efd8 instead of
  aee38ea95419
--

commit 43888afc681de375614e3f79133646abba848ae0
Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>

> sched/deadline: Replenish a throttled task boosted while asleep
>
> A deadline task can be throttled as it blocks, with an rt_mutex held.
> Its replenishment timer is then armed. A deadline waiter can boost the
> task while it sleeps.
>
> Commit feff2e65efd8 ("sched/deadline: Unthrottle PI boosted threads
> while enqueuing") lets a boost override the throttle. enqueue_task_dl()
> lifts the throttle of a boosted task, and dl_task_timer() ignores a
> boosted task. This covers a task that is enqueued while boosted. But a
> boost of a sleeping task does not enqueue it.
>
> T is a SCHED_DEADLINE task that holds the rt_mutex L. W is a
> SCHED_DEADLINE task with an earlier deadline:
>
>   T                                  W                              T's timer
>
>   uses up its runtime, sleeps
>     dl_throttled = 1
>     start_dl_timer()
>                                      pthread_mutex_timedlock(L)
>                                        rt_mutex_setprio(T, W)
>                                        T sleeps: no enqueue
>                                                                     dl_task_timer()
>                                                                       T is boosted: returns
>                                      times out
>                                        rt_mutex_setprio(T, NULL)
>   wakes up
>     enqueue_dl_entity()
>       dl_throttled: waits for the timer
>
> The timer has already fired. T would never run again, not even to die
> of SIGKILL. Every later waiter on L would hang too. This was found by
> reading.
>
> Fix this by returning early in dl_task_timer() only for a boosted task
> that is queued. A boosted task that sleeps then takes the existing path
> for a throttled task that is not queued: it is replenished.
>
> The timer refills the task from the parameters of its donor. After the
> deboost, the task keeps the runtime and the deadline of that refill.
> Its wakeup then checks them against its own parameters, as any wakeup
> does. On v7.4-rc2, a queued boosted task also keeps the values of its
> donor after the deboost. The priority inheritance series gives the
> task its own values back.
>
> The refill relies on two earlier patches:
> - "sched/deadline: Hold a reference on the deadline donor of a boosted
>   task" is earlier in this series. It keeps the donor from being freed
>   while the task points to it. A chain walk that has not reached the
>   task yet leaves it on an old donor. The refill then uses the
>   parameters of that old donor, as for a queued boosted task.
> - "sched/deadline: Do not replenish a boost from cleared parameters" is
>   in the first series. It keeps the refill from looping on the
>   parameters of a donor that left the class.
>
> The Sashiko AI review of this series found this.
>
> Fixes: feff2e65efd8 ("sched/deadline: Unthrottle PI boosted threads while enqueuing")
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Reviewed-by: Juri Lelli <juri.lelli@redhat.com>
> Cc: stable@vger.kernel.org

[Severity: Low]
Should the Fixes tag cite aee38ea95419 ("sched/deadline: Fix races
between rt_mutex_setprio() and dl_task_timer()") instead of feff2e65efd8
("sched/deadline: Unthrottle PI boosted threads while enqueuing")?

That commit only changed enqueue_task_dl() and did not touch
dl_task_timer().  The unconditional boosted early return in
dl_task_timer() was already present from the earlier commit, so this hang
existed before the enqueue_task_dl() change.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1796296313.git.mathieu.desnoyers@efficios.com?part=2

  reply	other threads:[~2026-12-03 15:29 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 14:58 [PATCH v14 00/39] sched/deadline: bandwidth accounting fixes and selftests Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 01/39] sched/deadline: Hold a reference on the deadline donor of a boosted task Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 02/39] sched/deadline: Replenish a throttled task boosted while asleep Mathieu Desnoyers
2026-12-03 15:29   ` sashiko-bot [this message]
2026-12-03 14:58 ` [PATCH v14 03/39] sched/deadline: Do not truncate a bandwidth to 32 bits in __dl_add/sub() Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 04/39] sched/deadline: Count the 0-lag time from the next period Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 05/39] sched/deadline: Clear dl_overrun under the rq lock Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 06/39] sched/deadline: Admit a returning task without the bandwidth it holds Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 07/39] sched/deadline: Leave an active task alone in the inactive timer Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 08/39] sched/deadline: Keep the deadline of a departed constrained task Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 09/39] sched/deadline: Keep departing bandwidth across a root domain rebuild Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 10/39] sched/deadline: Rebuild the root domains' accounting from the task list Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 11/39] sched/deadline: Record the root domain holding a task's bandwidth Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 12/39] sched/deadline: Leave a dying task out of a rebuild of the accounting Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 13/39] selftests/sched: Test SCHED_DEADLINE bandwidth across a root domain rebuild Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 14/39] selftests/sched: Test the root domain rebuild in deadline_bw_test Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 15/39] sched/deadline: Move a task's bandwidth only where room was made Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 16/39] cgroup/cpuset: Wait for an attach before rebuilding the sched domains Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 17/39] sched: Make deadline policy and affinity changes wait for a cpuset attach Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 18/39] cgroup/cpuset: Give back the bandwidth an attach did not move Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 19/39] cgroup/cpuset: Reserve the bandwidth in the root domain a task moves to Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 20/39] selftests/sched: Test cpuset moves in deadline_bw_test Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 21/39] sched/deadline: Make a rebuild count a task in the root domain it runs in Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 22/39] sched/deadline: Move a task's bandwidth to " Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 23/39] sched/deadline: Keep a task in the root domain that counts its bandwidth Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 24/39] sched/deadline: Keep the last CPU a task has in its root domain Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 25/39] cgroup/cpuset: Refuse to take a deadline task out of " Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 26/39] selftests/sched: Test the root domain of a task in deadline_bw_test Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 27/39] sched/deadline: Count only active CPUs when spreading extra_bw Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 28/39] sched/deadline: Cancel the replenishment timer with the parameters Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 29/39] sched/deadline: Cap the runtime left of a constrained task at dl_runtime Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 30/39] sched/deadline: Check the runtime of a task that comes back runnable Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 31/39] sched/deadline: Record the start of the period Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 32/39] sched/deadline: Keep the debt of a task across a change of parameters Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 33/39] selftests/sched: Test parameter changes in deadline_bw_test Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 34/39] sched/deadline: Count a task that departs while a rebuild walks the tasks Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 35/39] sched/deadline: Count again a departed task that a boost brings back Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 36/39] sched/deadline: Keep a reaped deadline task in a rebuild Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 37/39] sched/deadline: Warn when a runqueue keeps the bandwidth of a task Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 38/39] selftests/sched: Test PI against hotplug and rebuilds in deadline_bw_test Mathieu Desnoyers
2026-12-03 14:58 ` [PATCH v14 39/39] selftests/sched: Share the helpers of the deadline tests Mathieu Desnoyers

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=sashiko-outbox-248109@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mkoutny@suse.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tj@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