From nobody Tue Apr 7 09:06:50 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0A6C835E920 for ; Fri, 13 Mar 2026 18:37:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773427038; cv=none; b=I02qUe7p/rczEdGYKJw5ucxg8uz8ZK5tZDdnaSiiq1OxkLbVO2OhU5bW21cz1QDZ5gJfOyyN851APGCZ6l6RXEaLUzjBnjZcndeUZk22hpWPf67pbF/FXQOuR1v+QAG54hMtajp0Pk4/iFJxUg8fsMPfPHm51SyAqlqG37HK2iQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773427038; c=relaxed/simple; bh=P/pR83MKRiACfrGiaHA51wmJYHuRlXM6TJZqCrxYf/w=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=fC+8M9qTFTVWGuRS5AqVjwr7tBN4W01LGbQ0IdAO3tkl722eJ6GkJHSQVutV+gUqKA29biTdGsykz3oZzWcB577zRCsYOjNwE/gLAcdSnQlqYweHpFeewvD1F/lhwzIhXwDOtjzMHQ7y1QR2o4+6jDQMXf94gdjeuvqpFaCuyC0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B31BC19421; Fri, 13 Mar 2026 18:37:17 +0000 (UTC) From: Joseph Salisbury To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot Cc: Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , linux-kernel@vger.kernel.org Subject: [PATCH] sched/rt: Rebuild domains only after successful RT sysctl writes Date: Fri, 13 Mar 2026 14:37:16 -0400 Message-ID: <20260313183716.990792-1-joseph.salisbury@oracle.com> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" sched_rt_handler() unconditionally calls rebuild_sched_domains() on exit. That means scheduler domains are rebuilt even for read-only sysctl access, and also after writes that fail validation and roll back to the old RT bandwidth values. Track whether the write path completed validation and global RT/DL updates, and rebuild scheduler domains only in that case. Fixes: 440989c10f4e ("sched/deadline: Fix accounting after global limits ch= ange") Cc: stable@vger.kernel.org Signed-off-by: Joseph Salisbury --- kernel/sched/rt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 906f6c656c2e..ada9249b22cd 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -2871,6 +2871,7 @@ static int sched_rt_handler(const struct ctl_table *t= able, int write, void *buff { int old_period, old_runtime; static DEFINE_MUTEX(mutex); + bool rebuild =3D false; int ret; =20 mutex_lock(&mutex); @@ -2895,6 +2896,7 @@ static int sched_rt_handler(const struct ctl_table *t= able, int write, void *buff =20 sched_rt_do_global(); sched_dl_do_global(); + rebuild =3D true; } if (0) { undo: @@ -2908,7 +2910,8 @@ static int sched_rt_handler(const struct ctl_table *t= able, int write, void *buff * After changing maximum available bandwidth for DEADLINE, we need to * recompute per root domain and per cpus variables accordingly. */ - rebuild_sched_domains(); + if (rebuild) + rebuild_sched_domains(); =20 return ret; } --=20 2.47.3