FAILED: patch "[PATCH] sched: Use u64 for bandwidth ratio calculations" failed to apply to 6.6-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x c6e80201e057dfb7253385e60bf541121bf5dc33
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026050159-quadrant-kilogram-1f30@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From c6e80201e057dfb7253385e60bf541121bf5dc33 Mon Sep 17 00:00:00 2001
From: Joseph Salisbury <[email protected]>
Date: Fri, 3 Apr 2026 17:00:14 -0400
Subject: [PATCH] sched: Use u64 for bandwidth ratio calculations
to_ratio() computes BW_SHIFT-scaled bandwidth ratios from u64 period and runtime values, but it returns unsigned long. tg_rt_schedulable() also stores the current group limit and the accumulated child sum in unsigned long.
On 32-bit builds, large bandwidth ratios can be truncated and the RT group sum can wrap when enough siblings are present. That can let an overcommitted RT hierarchy pass the schedulability check, and it also narrows the helper result for other callers.
Return u64 from to_ratio() and use u64 for the RT group totals so bandwidth ratios are preserved and compared at full width on both 32-bit and 64-bit builds.
kernel/sched/core.c +1 -1
@@ -4735,7 +4735,7 @@ void sched_post_fork(struct task_struct *p)scx_post_fork (p); } -unsigned long to_ratio (u64 period,u64 runtime) +u64 to_ratio (u64 period,u64 runtime) {if (runtime ==RUNTIME_INF )return BW_UNIT ;
kernel/sched/rt.c +1 -1
@@ -2666,7 +2666,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);
kernel/sched/sched.h +1 -1
@@ -2907,7 +2907,7 @@ extern void init_cfs_throttle_work(struct task_struct *p);#define MAX_BW_BITS (64 - BW_SHIFT)#define MAX_BW ((1ULL << MAX_BW_BITS) - 1) -extern unsigned long to_ratio (u64 period,u64 runtime); +extern u64 to_ratio (u64 period,u64 runtime);extern void init_entity_runnable_average (struct sched_entity *se);extern void post_init_entity_util_avg (struct task_struct *p);
Sasha Levin
maintainerPATCH 1/1 sched: Use u64 for bandwidth ratio calculations
From: Joseph Salisbury <[email protected]>
[ Upstream commit c6e80201e057dfb7253385e60bf541121bf5dc33 ]
to_ratio() computes BW_SHIFT-scaled bandwidth ratios from u64 period and runtime values, but it returns unsigned long. tg_rt_schedulable() also stores the current group limit and the accumulated child sum in unsigned long.
On 32-bit builds, large bandwidth ratios can be truncated and the RT group sum can wrap when enough siblings are present. That can let an overcommitted RT hierarchy pass the schedulability check, and it also narrows the helper result for other callers.
Return u64 from to_ratio() and use u64 for the RT group totals so bandwidth ratios are preserved and compared at full width on both 32-bit and 64-bit builds.
--- kernel/sched/core.c | 2 +- kernel/sched/rt.c | 2 +- kernel/sched/sched.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
kernel/sched/core.c +1 -1
@@ -4823,7 +4823,7 @@ void sched_post_fork(struct task_struct *p)uclamp_post_fork (p); } -unsigned long to_ratio (u64 period,u64 runtime) +u64 to_ratio (u64 period,u64 runtime) {if (runtime ==RUNTIME_INF )return BW_UNIT ;
kernel/sched/rt.c +1 -1
@@ -2776,7 +2776,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);
kernel/sched/sched.h +1 -1
@@ -2463,7 +2463,7 @@ extern void init_dl_entity(struct sched_dl_entity *dl_se);#define RATIO_SHIFT 8#define MAX_BW_BITS (64 - BW_SHIFT)#define MAX_BW ((1ULL << MAX_BW_BITS) - 1) -unsigned long to_ratio (u64 period,u64 runtime); +u64 to_ratio (u64 period,u64 runtime);extern void init_entity_runnable_average (struct sched_entity *se);extern void post_init_entity_util_avg (struct task_struct *p);
Signature · 1 line
2.53.0