mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: sashiko-reviews@lists.linux.dev
Cc: linux-rt-devel@lists.linux.dev, tj@kernel.org,
	hannes@cmpxchg.org, mkoutny@suse.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 09/17] sched/deadline: Reset the deadline and the runtime with the parameters
Date: Thu, 19 Nov 2026 11:06:31 -0500	[thread overview]
Message-ID: <5b84b238-d234-49b8-a6bb-4b43d0d811f4@efficios.com> (raw)
In-Reply-To: <sashiko-outbox-223274@kernel.org>

> Can a task still keep its donor's runtime and deadline after a priority
> inheritance deboost when p->dl.dl_runtime is non-zero?

Yes, by reading. This is older than this patch, and the second series
fixes it:
- "sched/deadline: Reset the donor's runtime at a deboost in the class"
  starts a new period at the deboost when the boost refilled the
  runtime from the donor. Its message names this sched_setattr() case.
- "sched/deadline: Check the runtime of a task whose parameters change"
  checks the new parameters at the deboost.
- "sched/deadline: Count the bandwidth a boosted task is given" adds
  the bandwidth to this_bw for a task that sleeps during the
  sched_setattr().

> Similarly, if a former SCHED_DEADLINE task is PI-boosted and deboosted
> before its 0-lag inactive_timer fires, switched_to_dl() cancels
> inactive_timer while p->dl.dl_runtime is still non-zero.  On deboost,
> switched_from_dl() skips the !p->dl.dl_runtime reset and passes the
> donor's deadline and runtime to task_non_contending().

Right, with one correction. The boost keeps the task's own runtime and
deadline. replenish_dl_entity() copies the donor's only for a task with
no parameters. The donor's values come in when the boosted task runs out
of runtime and is refilled from the donor. The 0-lag time then mixes
them with the task's own parameters. The bandwidth is released too early
or too late. This is older than this patch too.

v8 of the second series will add "sched/deadline: Start a period at a
deboost out of the class". After a refill from the donor,
switched_from_dl() starts a period of the task's own, as the deboost in
the class does. The bandwidth is then released at once. Its new case,
deboost_out_after_donor_refill, failed in 40 runs of 40 without it.

> Does clearing deadline, runtime, and dl_throttled here without canceling
> dl_se->dl_timer leave a stale replenishment timer armed for the old
> period?

Right, and older than this patch. The second series fixes it in
"sched/deadline: Cancel the replenishment timer with the parameters".

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com

  reply	other threads:[~2026-11-19 16:06 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 13:49 [PATCH v3 00/17] sched/deadline: first bandwidth accounting fixes and selftests Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 01/17] sched: Refuse SCHED_FLAG_KEEP_PARAMS that would change the policy or the class Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 02/17] sched/deadline: Do not admit bandwidth for parameters that are kept Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 03/17] sched: Let a task boosted by a deadline waiter change its policy Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 04/17] sched/deadline: Do not divide by zero active CPUs of a root domain Mathieu Desnoyers
2026-11-19 14:08   ` sashiko-bot
2026-11-19 16:05     ` Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 05/17] sched/deadline: Refuse dl_server debugfs writes while the rq is offline Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 06/17] sched: Take cpuset_mutex for a deadline policy change only with pi Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 07/17] sched/deadline: Do not lose a throttled task switched out and back Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 08/17] sched/deadline: Do not replenish a boost from cleared parameters Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 09/17] sched/deadline: Reset the deadline and the runtime with the parameters Mathieu Desnoyers
2026-11-19 14:17   ` sashiko-bot
2026-11-19 16:06     ` Mathieu Desnoyers [this message]
2026-11-19 13:49 ` [PATCH v3 10/17] sched/deadline: Fix an overflow of the 0-lag time with long periods Mathieu Desnoyers
2026-11-19 14:07   ` sashiko-bot
2026-11-19 16:07     ` Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 11/17] sched/deadline: Release the bandwidth of a task that leaves the class asleep Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 12/17] sched/deadline: Reject SCHED_DEADLINE on exited tasks Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 13/17] sched/deadline: Fix this_bw when a task is changed during a remote wakeup Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 14/17] sched/deadline: Check SCHED_DEADLINE affinity under the rq lock Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 15/17] sched/debug: Show the deadline bandwidth of each runqueue Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 16/17] selftests/sched: Add a test of SCHED_DEADLINE policy round trips Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 17/17] selftests/sched: Add a test of SCHED_DEADLINE bandwidth accounting Mathieu Desnoyers
2026-11-19 14:22   ` sashiko-bot
2026-11-19 16:07     ` 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=5b84b238-d234-49b8-a6bb-4b43d0d811f4@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --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

all inboxes | Powered by JetHome®