mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Juri Lelli" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Marcel Ziswiler <marcel.ziswiler@codethink.co.uk>,
	Juri Lelli <juri.lelli@redhat.com>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/core] sched/deadline: Reset extra_bw to max_bw when clearing root domains
Date: Mon, 14 Jul 2025 09:10:42 -0000	[thread overview]
Message-ID: <175248424206.406.15367578865918982351.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20250627115118.438797-3-juri.lelli@redhat.com>

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     fcc9276c4d331cd1fe9319d793e80b02e09727f5
Gitweb:        https://git.kernel.org/tip/fcc9276c4d331cd1fe9319d793e80b02e09727f5
Author:        Juri Lelli <juri.lelli@redhat.com>
AuthorDate:    Fri, 27 Jun 2025 13:51:15 +02:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Mon, 14 Jul 2025 10:59:32 +02:00

sched/deadline: Reset extra_bw to max_bw when clearing root domains

dl_clear_root_domain() doesn't take into account the fact that per-rq
extra_bw variables retain values computed before root domain changes,
resulting in broken accounting.

Fix it by resetting extra_bw to max_bw before restoring back dl-servers
contributions.

Fixes: 2ff899e351643 ("sched/deadline: Rebuild root domain accounting after every update")
Reported-by: Marcel Ziswiler <marcel.ziswiler@codethink.co.uk>
Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Marcel Ziswiler <marcel.ziswiler@codethink.co.uk> # nuc & rock5b
Link: https://lore.kernel.org/r/20250627115118.438797-3-juri.lelli@redhat.com
---
 kernel/sched/deadline.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 0d25553..0abffe3 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -2924,7 +2924,14 @@ void dl_clear_root_domain(struct root_domain *rd)
 	int i;
 
 	guard(raw_spinlock_irqsave)(&rd->dl_bw.lock);
+
+	/*
+	 * Reset total_bw to zero and extra_bw to max_bw so that next
+	 * loop will add dl-servers contributions back properly,
+	 */
 	rd->dl_bw.total_bw = 0;
+	for_each_cpu(i, rd->span)
+		cpu_rq(i)->dl.extra_bw = cpu_rq(i)->dl.max_bw;
 
 	/*
 	 * dl_servers are not tasks. Since dl_add_task_root_domain ignores

  reply	other threads:[~2025-07-14  9:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-27 11:51 [PATCH 0/5] sched/deadline: Fix GRUB accounting Juri Lelli
2025-06-27 11:51 ` [PATCH 1/5] sched/deadline: Initialize dl_servers after SMP Juri Lelli
     [not found]   ` <1e39c473-d161-4ad0-bfdc-8a306f57135f@redhat.com>
2025-06-29 23:08     ` Waiman Long
2025-06-30 10:21     ` Juri Lelli
2025-06-30 17:04       ` Waiman Long
2025-07-14  9:10   ` [tip: sched/core] " tip-bot2 for Juri Lelli
2025-06-27 11:51 ` [PATCH 2/5] sched/deadline: Reset extra_bw to max_bw when clearing root domains Juri Lelli
2025-07-14  9:10   ` tip-bot2 for Juri Lelli [this message]
2025-06-27 11:51 ` [PATCH 3/5] sched/deadline: Fix accounting after global limits change Juri Lelli
2025-07-14  8:59   ` Peter Zijlstra
2025-07-15 10:07     ` Juri Lelli
2025-07-14  9:10   ` [tip: sched/core] " tip-bot2 for Juri Lelli
2025-06-27 11:51 ` [PATCH 4/5] tools/sched: Add root_domains_dump.py which dumps root domains info Juri Lelli
2025-07-14  9:10   ` [tip: sched/core] " tip-bot2 for Juri Lelli
2025-06-27 11:51 ` [PATCH 5/5] tools/sched: Add dl_bw_dump.py for printing bandwidth accounting info Juri Lelli
2025-07-14  9:10   ` [tip: sched/core] " tip-bot2 for Juri Lelli
2025-06-30  6:01 ` [PATCH 0/5] sched/deadline: Fix GRUB accounting Marcel Ziswiler
2025-07-11 10:05 ` Marcel Ziswiler

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=175248424206.406.15367578865918982351.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=marcel.ziswiler@codethink.co.uk \
    --cc=peterz@infradead.org \
    --cc=x86@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®