From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: sashiko-reviews@lists.linux.dev
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-rt-devel@lists.linux.dev, tj@kernel.org,
hannes@cmpxchg.org, mkoutny@suse.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v13 22/36] cgroup/cpuset: Refuse to take a deadline task out of its root domain
Date: Wed, 2 Dec 2026 09:54:22 -0500 [thread overview]
Message-ID: <20261202145428.341797-5-mathieu.desnoyers@efficios.com> (raw)
In-Reply-To: <sashiko-outbox-244064@kernel.org>
> Could dl_tasks_hold_bw() be checked on entry to dl_tasks_keep_without()
> and dl_tasks_keep_root_domain() instead of only inside
> dl_tasks_keep_cpus()? Because cpuset_mutex prevents any task from
> acquiring deadline bandwidth during the check, testing it only at the leaf
> causes every cpuset mask and partition update to walk all descendant
> cpusets and recompute effective_cpus_below() even when no task in the
> system holds deadline bandwidth.
It could, but the gain is small. dl_tasks_keep_cpus() already calls
dl_tasks_hold_bw() first. So with no deadline bandwidth held, the walk
of the tasks does not run. Only the walk of the cpusets stays. It runs
only when the cpusets change: on a write to a cpuset, or when a CPU
hotplug makes a partition valid again. update_cpumasks_hier() walks the
same cpusets on a write. The v12 review asked the same. v14 will leave
it as it is.
> When cpumask_equal(cp->effective_cpus, new_cpus) is true here, in the
> second loop below, and in dl_tasks_keep_root_domain(), should the loop
> advance pos_css = css_rightmost_descendant(pos_css) before continuing?
> Since valid child partitions are already skipped and non-partition
> descendants derive their effective_cpus only from their parent's
> effective_cpus and their own unchanged cpus_allowed, no descendant in cp's
> subtree can change effective_cpus, yet a plain continue walks every
> descendant in unaffected subtrees and runs effective_cpus_below() on each
> of them.
The same answer as above. The extra cost is a walk of the cpusets, and
only when the cpusets change. v14 will leave it as it is.
> When an update to a valid PRS_ISOLATED partition invalidates it, can
> returning all of cs->effective_xcpus to a non-isolated parent move a
> deadline task out of the default root domain without being caught by
> dl_tasks_keep_given_back()?
Yes. In v14, such a write will fail with EBUSY if a deadline task in
the partition would then change root domain. To know whether the write
makes the partition invalid, the check will repeat the tests of
partition_cpus_change(). A new case, partition_invalidate_refused, will
test it.
> Can shrinking a partition still move a deadline task in the parent's
> hierarchy out of its root domain in cases that dl_tasks_keep_given_back()
> skips?
Yes. In v14, a write to cpuset.cpus or cpuset.cpus.exclusive will fail
with EBUSY if a deadline task would then leave its root domain. The
check will cover these writes:
- A write that only gives CPUs back. It will check the tasks of the
parent (paths 1 and 2).
- A write that takes away all the CPUs of a partition root below. It
will check the tasks of that partition (path 3).
A write that only shrinks a partition root below is not checked. The
tasks of that partition keep the CPUs left to it. New cases will test
the refusals: partition_shrink_moves_refused,
partition_shrink_isolated_moves_refused and
partition_child_invalidate_refused.
Thanks,
Mathieu
next prev parent reply other threads:[~2026-12-02 14:54 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 17:43 [PATCH v13 00/36] sched/deadline: bandwidth accounting fixes and selftests Mathieu Desnoyers
2026-12-01 17:43 ` [PATCH v13 01/36] sched/deadline: Hold a reference on the deadline donor of a boosted task Mathieu Desnoyers
2026-12-02 9:43 ` Juri Lelli
2026-12-01 17:43 ` [PATCH v13 02/36] sched/deadline: Replenish a throttled task boosted while asleep Mathieu Desnoyers
2026-12-01 17:43 ` [PATCH v13 03/36] sched/deadline: Do not truncate a bandwidth to 32 bits in __dl_add/sub() Mathieu Desnoyers
2026-12-01 17:43 ` [PATCH v13 04/36] sched/deadline: Count the 0-lag time from the next period Mathieu Desnoyers
2026-12-01 17:43 ` [PATCH v13 05/36] sched/deadline: Keep a departing constrained task until its " Mathieu Desnoyers
2026-12-01 18:17 ` sashiko-bot
2026-12-02 14:54 ` Mathieu Desnoyers
2026-12-02 14:55 ` Juri Lelli
2026-12-01 17:44 ` [PATCH v13 06/36] sched/deadline: Keep departing bandwidth across a root domain rebuild Mathieu Desnoyers
2026-12-01 18:20 ` sashiko-bot
2026-12-02 14:54 ` Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 07/36] sched/deadline: Rebuild the root domains' accounting from the task list Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 08/36] sched/deadline: Record the root domain holding a task's bandwidth Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 09/36] sched/deadline: Leave a dying task out of a rebuild of the accounting Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 10/36] selftests/sched: Test SCHED_DEADLINE bandwidth across a root domain rebuild Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 11/36] selftests/sched: Test the root domain rebuild in deadline_bw_test Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 12/36] sched/deadline: Move a task's bandwidth only where room was made Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 13/36] cgroup/cpuset: Wait for an attach before rebuilding the sched domains Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 14/36] sched: Make deadline policy and affinity changes wait for a cpuset attach Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 15/36] cgroup/cpuset: Give back the bandwidth an attach did not move Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 16/36] cgroup/cpuset: Reserve the bandwidth in the root domain a task moves to Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 17/36] selftests/sched: Test cpuset moves in deadline_bw_test Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 18/36] sched/deadline: Make a rebuild count a task in the root domain it runs in Mathieu Desnoyers
2026-12-01 19:11 ` sashiko-bot
2026-12-02 14:54 ` Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 19/36] sched/deadline: Move a task's bandwidth to " Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 20/36] sched/deadline: Keep a task in the root domain that counts its bandwidth Mathieu Desnoyers
2026-12-01 19:02 ` sashiko-bot
2026-12-02 14:54 ` Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 21/36] sched/deadline: Keep the last CPU a task has in its root domain Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 22/36] cgroup/cpuset: Refuse to take a deadline task out of " Mathieu Desnoyers
2026-12-01 19:29 ` sashiko-bot
2026-12-02 14:54 ` Mathieu Desnoyers [this message]
2026-12-01 17:44 ` [PATCH v13 23/36] selftests/sched: Test the root domain of a task in deadline_bw_test Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 24/36] sched/deadline: Count only active CPUs when spreading extra_bw Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 25/36] sched/deadline: Cancel the replenishment timer with the parameters Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 26/36] sched/deadline: Cap the runtime left of a constrained task at dl_runtime Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 27/36] sched/deadline: Check the runtime of a task that comes back runnable Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 28/36] sched/deadline: Record the start of the period Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 29/36] sched/deadline: Keep the debt of a task across a change of parameters Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 30/36] selftests/sched: Test parameter changes in deadline_bw_test Mathieu Desnoyers
2026-12-01 19:34 ` sashiko-bot
2026-12-02 14:54 ` Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 31/36] sched/deadline: Count a task that departs while a rebuild walks the tasks Mathieu Desnoyers
2026-12-01 19:41 ` sashiko-bot
2026-12-02 14:54 ` Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 32/36] sched/deadline: Count again a departed task that a boost brings back Mathieu Desnoyers
2026-12-01 19:47 ` sashiko-bot
2026-12-02 14:54 ` Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 33/36] sched/deadline: Keep a reaped deadline task in a rebuild Mathieu Desnoyers
2026-12-01 19:57 ` sashiko-bot
2026-12-02 14:54 ` Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 34/36] sched/deadline: Warn when a runqueue keeps the bandwidth of a task Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 35/36] selftests/sched: Test PI against hotplug and rebuilds in deadline_bw_test Mathieu Desnoyers
2026-12-01 19:51 ` sashiko-bot
2026-12-02 14:54 ` Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 36/36] 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=20261202145428.341797-5-mathieu.desnoyers@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®