[PATCH] sched/rt: use u64 for RT group bandwidth accounting
From: Joseph Salisbury
Date: Tue Mar 17 2026 - 15:40:17 EST
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@xxxxxxxxxxxxxxx
Assisted-by: Codex:GPT-5
Signed-off-by: Joseph Salisbury <joseph.salisbury@xxxxxxxxxx>
---
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