From: Juri Lelli <juri.lelli@redhat.com>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Valentin Schneider <vschneid@redhat.com>,
K Prateek Nayak <kprateek.nayak@amd.com>,
Luca Abeni <luca.abeni@santannapisa.it>,
linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>,
Weiheng Qiu <weihengqiuu@gmail.com>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH 1/4] sched/deadline: Fix stale root domain in cpuset bandwidth transfer
Date: Thu, 5 Nov 2026 11:38:41 +0100 [thread overview]
Message-ID: <auxcsYGC7Fqa44LM@jlelli-thinkpadt14gen4.remote.csb> (raw)
In-Reply-To: <eb0e386b-da07-4a2b-bff3-79441fd6be1f@samsung.com>
Hello,
On 05/11/26 11:20, Marek Szyprowski wrote:
> On 03.11.2026 12:26, Juri Lelli wrote:
> > dl_task_needs_bw_move() and set_cpus_allowed_dl() use task_rq(p)->rd
> > to determine a task's current root domain. For a sleeping task, this
> > is stale: it points to the rq of the CPU the task last ran on, which
> > may belong to a different root domain after a cpuset move.
> >
> > This causes incorrect bandwidth accounting when a sleeping DL task is
> > moved between exclusive cpuset partitions and back:
> >
> > 1. Move root->partition: task_rq(p)->rd = root, destination in
> > partition -> different -> bandwidth transferred correctly.
> > 2. Move partition->root: task_rq(p)->rd is still root (task never
> > ran) -> looks like same domain -> no transfer. Partition keeps
> > stale bandwidth, root domain is short.
> >
> > The root domain then over-admits, and when the task exits total_bw
> > underflows.
> >
> > Introduce dl_task_root_domain_cpu() helper that uses the task's
> > cpus_mask (which still reflects the old/source cpuset at call time)
> > to find the root domain where the bandwidth is actually accounted,
> > instead of relying on the potentially stale task_rq(p)->rd.
> >
> > Use cpus_mask rather than cpus_ptr, as the latter may be temporarily
> > narrowed to a single CPU by migrate_disable().
> >
> > Reported-by: Weiheng Qiu <weihengqiuu@gmail.com>
> > Closes: https://lore.kernel.org/all/14508cb2-805f-41ac-9f6b-bfd7c3d7cb1c@gmail.com/
> > Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
> This patch landed recently in linux-next as commit b4a61fdc19c5
> ("sched/deadline: Fix stale root domain in cpuset bandwidth transfer").
> I found that it triggers kernel BUG during CPU hot-plug tests on some
> of my tests boards. Reverting it on top of next-20261104 (together with
> dependent 41a7968022ca3) fixes the issue.
Others have found issues with the set and we have been working on fixes.
Can you please check if the following addresses it
https://lore.kernel.org/lkml/20261104211207.1392343-1-mathieu.desnoyers@efficios.com/
Thanks,
Juri
next prev parent reply other threads:[~2026-11-05 10:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 11:26 [PATCH 0/4] sched/deadline: Fix assorted dl_bw accounting bugs Juri Lelli
2026-11-03 11:26 ` [PATCH 1/4] sched/deadline: Fix stale root domain in cpuset bandwidth transfer Juri Lelli
2026-11-03 13:26 ` [tip: sched/urgent] " tip-bot2 for Juri Lelli
[not found] ` <CGME20261105102052eucas1p2fa2d23d1c49cdadef3b1099e18ffb958@eucas1p2.samsung.com>
2026-11-05 10:20 ` [PATCH 1/4] " Marek Szyprowski
2026-11-05 10:38 ` Juri Lelli [this message]
2026-11-05 11:16 ` Marek Szyprowski
2026-11-05 11:22 ` Ingo Molnar
2026-11-05 11:32 ` Juri Lelli
2026-11-03 11:26 ` [PATCH 2/4] sched/deadline: Fix total_bw leak when switching away from SCHED_DEADLINE while !queued Juri Lelli
2026-11-03 13:26 ` [tip: sched/urgent] " tip-bot2 for Juri Lelli
2026-11-03 11:26 ` [PATCH 3/4] sched: Reject SCHED_FLAG_KEEP_PARAMS when it would change scheduling class Juri Lelli
2026-11-03 13:26 ` [tip: sched/urgent] " tip-bot2 for Juri Lelli
2026-11-03 11:26 ` [PATCH 4/4] sched/deadline: Reject SCHED_DEADLINE on exited tasks Juri Lelli
2026-11-03 13:25 ` [tip: sched/urgent] " tip-bot2 for Juri Lelli
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=auxcsYGC7Fqa44LM@jlelli-thinkpadt14gen4.remote.csb \
--to=juri.lelli@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.abeni@santannapisa.it \
--cc=m.szyprowski@samsung.com \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tj@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=weihengqiuu@gmail.com \
/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®