mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched/rt: use u64 for RT group bandwidth accounting
@ 2026-03-17 19:34 Joseph Salisbury
  2026-04-01  9:48 ` Michal Koutný
  0 siblings, 1 reply; 3+ messages in thread
From: Joseph Salisbury @ 2026-03-17 19:34 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot
  Cc: Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, linux-kernel

tg_rt_schedulable() sums the bandwidth ratios of all child RT groups
and compares the result against the bandwidth available to the parent.

On 32-bit builds, the running sum is stored in unsigned long and can
overflow when enough child groups are present.  In that case, an
overcommitted hierarchy may incorrectly pass the schedulability check.

Use u64 for the local bandwidth totals so the accumulated child sum and
the parent limit are compared without 32-bit overflow.

Fixes: b40b2e8eb521 ("sched: rt: multi level group constraints")
Cc: stable@vger.kernel.org
Assisted-by: Codex:GPT-5
Signed-off-by: Joseph Salisbury <joseph.salisbury@oracle.com>
---
 kernel/sched/rt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index f69e1f16d923..906f6c656c2e 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -2652,7 +2652,7 @@ static int tg_rt_schedulable(struct task_group *tg, void *data)
 {
 	struct rt_schedulable_data *d = data;
 	struct task_group *child;
-	unsigned long total, sum = 0;
+	u64 total, sum = 0;
 	u64 period, runtime;
 
 	period = ktime_to_ns(tg->rt_bandwidth.rt_period);
-- 
2.47.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-03 20:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-17 19:34 [PATCH] sched/rt: use u64 for RT group bandwidth accounting Joseph Salisbury
2026-04-01  9:48 ` Michal Koutný
2026-04-03 20:29   ` Joseph Salisbury

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®