From: Juri Lelli <juri.lelli@redhat.com>
To: Hui Su <sh_def@163.com>
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Mikhail Zaslonko <zaslonko@linux.ibm.com>,
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>,
Daniel Bristot de Oliveira <bristot@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] sched/deadline: Fix divide-by-zero in DL bandwidth accounting
Date: Tue, 22 Sep 2026 14:29:31 +0200 [thread overview]
Message-ID: <arJ0q2YDoJdPVLTz@jlelli-thinkpadt14gen4.remote.csb> (raw)
In-Reply-To: <20260919153150.2618403-2-sh_def@163.com>
Hello,
On 20/09/26 00:31, Hui Su wrote:
> During CPU hot-unplug, a CPU can be cleared from cpu_active_mask before it
> is marked offline. This can leave a window where dl_bw_cpus() returns zero
> for a root domain with no remaining active CPU.
>
> DL bandwidth paths can pass this zero CPU count to __dl_sub() and
> __dl_add(), which then divide by zero while distributing the bandwidth
> update to active runqueues.
>
> This is not specific to the DL server debugfs path. Mikhail Zaslonko
> reported the same failure on s390x through sched_setscheduler(), where
> task_non_contending() reached __dl_sub() with no active CPU in the root
> domain. Other DL bandwidth paths use the same helpers.
>
> Keep updating dl_bw::total_bw when the CPU count is zero, but skip
> __dl_update(), since there are no active runqueues to receive an extra_bw
> adjustment. This avoids the division by zero in all callers while retaining
> the existing total_bw update.
>
> Fixes: daec57983670 ("sched/deadline: Reclaim bandwidth not used by dl tasks")
> Reported-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
> Link: https://lore.kernel.org/r/c52c9e8c-260e-49a4-a88e-229e0795d07b@linux.ibm.com
> Suggested-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
> Cc: stable@vger.kernel.org
> Assisted-by: LLM
> Signed-off-by: Hui Su <sh_def@163.com>
> ---
Looks good to me.
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Thanks,
Juri
next prev parent reply other threads:[~2026-09-22 12:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 15:31 [PATCH v2 0/2] sched/deadline: Fix zero-CPU DL bandwidth handling Hui Su
2026-09-19 15:31 ` [PATCH v2 1/2] sched/deadline: Fix divide-by-zero in DL bandwidth accounting Hui Su
2026-09-22 12:29 ` Juri Lelli [this message]
2026-09-19 15:31 ` [PATCH v2 2/2] sched/deadline: Reject debugfs dl_server writes for inactive CPUs Hui Su
2026-09-22 12:30 ` 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=arJ0q2YDoJdPVLTz@jlelli-thinkpadt14gen4.remote.csb \
--to=juri.lelli@redhat.com \
--cc=bristot@kernel.org \
--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=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sh_def@163.com \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=zaslonko@linux.ibm.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®