From nobody Tue Oct 7 05:33:22 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEF4B23C4FF; Mon, 14 Jul 2025 09:10:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752484246; cv=none; b=cKZMg578hjRfXN2t90hGUldc3COvIeMzzXBqjnheMp5El0yIHdvIi4siLaFrCJ7uoD2Id92RBn/5juT4k6HBmxGRGAzVLvQMgP6sHc2EcOtzM0JI9AixnsbMjtm4U46xdmpgq9Izbs8HJZ8wAYgQBQq7Xl7NYVANRawRvNDP3OY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752484246; c=relaxed/simple; bh=UYGkoqO+tyCX79kMRrmJVpJ9DSRmlL5JPFfbTWtgMQg=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=EiyXsYg0DB79RAZX2+d3Y6DRBxpei7heGkX5YKsvEOUu7OHKy1F43iVgFHj2GW82ueFTx96k02GPhgBjns/WXGQDn/zZI9VsZ3LIXTQUyqMzk22L1TGYVD+4Ah6flCoAmKBruEMCc0HbsRZs+gprsPJEL235XUBRnjmfg4hGbv4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=1G15Fc26; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=7MsaQwWy; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="1G15Fc26"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="7MsaQwWy" Date: Mon, 14 Jul 2025 09:10:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1752484243; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RlBDfz1Ybicy8RoQaJ+iWnPoP55Jzv4mPJoiHMHteMY=; b=1G15Fc265XkXcPb9w5L3tj8q7JYjF2VtuTUxPTeT5H9AfMoOvWeCwUM7XF2wDbq5X8O/eC etdydnNTE2cnO/jHfDvyM3PzN8aRySTD2PFJkyPpGD4T1J2VtscOWrCstgs36mdF7bSpUM zZhALRVl+sFulM+WOBApugtNPr/dakBghSEXo+JszOVlFY9L3RpBMPwLu0HvA5vZoZRWDw r8a6kBglA/imLSOVHZvyhmI09Lpj5qVWY3Gu5PmIdAcWPfRsrHK8jLZbZnBwCGnAnn+358 bp3VrADa6zmgcLYKeoWYG7Dt7zePWmptsi7YegbnZU3yo3aSiB1D551w2fnuFg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1752484243; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RlBDfz1Ybicy8RoQaJ+iWnPoP55Jzv4mPJoiHMHteMY=; b=7MsaQwWySzYevYKY7zGJjTqZ/ECq1GDpR9bPZ8S18rJhylXF1y4t4l8b1c9HP0txr/EQkN ZCYqlq5x+9OetPAA== From: "tip-bot2 for Juri Lelli" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/deadline: Reset extra_bw to max_bw when clearing root domains Cc: Marcel Ziswiler , Juri Lelli , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20250627115118.438797-3-juri.lelli@redhat.com> References: <20250627115118.438797-3-juri.lelli@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <175248424206.406.15367578865918982351.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the sched/core branch of tip: Commit-ID: fcc9276c4d331cd1fe9319d793e80b02e09727f5 Gitweb: https://git.kernel.org/tip/fcc9276c4d331cd1fe9319d793e80b02e= 09727f5 Author: Juri Lelli AuthorDate: Fri, 27 Jun 2025 13:51:15 +02:00 Committer: Peter Zijlstra 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 Signed-off-by: Juri Lelli Signed-off-by: Peter Zijlstra (Intel) Tested-by: Marcel Ziswiler # nuc & rock5b Link: https://lore.kernel.org/r/20250627115118.438797-3-juri.lelli@redhat.c= om --- 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; =20 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 =3D 0; + for_each_cpu(i, rd->span) + cpu_rq(i)->dl.extra_bw =3D cpu_rq(i)->dl.max_bw; =20 /* * dl_servers are not tasks. Since dl_add_task_root_domain ignores