From mboxrd@z Thu Jan 1 00:00:00 1970 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 EE42239B488 for ; Fri, 1 May 2026 11:04:15 +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=1777633456; cv=none; b=GtN739+uqzogZl3okEchGJtTLspPrl2j14iyKi4Um+o0ytDApj7+SohPtEtI0ief7jG9yHX3fhjY2eb2HNHtHzxyWPnzL2MMexobA/Gm5lpO7pAbSTQgcWVP7ZDd0IjiATAzwPTMWNFbEthyErhMToOYQLZtn+b/nVXpPFWb6HU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777633456; c=relaxed/simple; bh=zzcmP6NlsR0l5z0Keg5IKgVFt/WrwpV4xmdCsr997Vk=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=Wc6Rpdz/33pxgO1XdciQb05rhBhxkAKmN2uyrMOYT3owaK1COYH8SHaP3w8WfT/z9AlRe+CI4EY8t2rukimGbEWobtm+wXAR3XWJHWnvQ+lVglNbYTIkif44eRywjAvpKVG1NeCFt47xgRwF4eeITc9WcZJuIF/nNQ+kNer0+Bc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Wd9M+9JH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Wd9M+9JH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09D34C2BCB4; Fri, 1 May 2026 11:04:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777633455; bh=zzcmP6NlsR0l5z0Keg5IKgVFt/WrwpV4xmdCsr997Vk=; h=Subject:To:Cc:From:Date:From; b=Wd9M+9JHrYc+MgO6FKeh4Y/S6uUC6+r9utEm1WzUYpCBU2rlC5h09ZwPFKJlmHSZr t0n9OflEbcnFSRApw3/HFMZtJFEp6kipFG3dDZpZWTLwd0fERJEBfjvD8jbd4/fFDN E7JXa0EkIhlojDIAr2UqkLTwrslkc1oIzx2oQi+o= Subject: FAILED: patch "[PATCH] sched: Use u64 for bandwidth ratio calculations" failed to apply to 5.10-stable tree To: joseph.salisbury@oracle.com,peterz@infradead.org Cc: From: Date: Fri, 01 May 2026 13:04:01 +0200 Message-ID: <2026050101-glamorous-absurd-e506@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.10-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 . 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-5.10.y git checkout FETCH_HEAD git cherry-pick -x c6e80201e057dfb7253385e60bf541121bf5dc33 # git commit -s git send-email --to '' --in-reply-to '2026050101-glamorous-absurd-e506@gregkh' --subject-prefix 'PATCH 5.10.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 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. Fixes: b40b2e8eb521 ("sched: rt: multi level group constraints") Assisted-by: Codex:GPT-5 Signed-off-by: Joseph Salisbury Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260403210014.2713404-1-joseph.salisbury@oracle.com diff --git a/kernel/sched/core.c b/kernel/sched/core.c index c15c9865299e..49cd5d217161 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -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; diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 4e5f1957b91b..a48e86794913 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -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); diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 9594355a3681..c95584191d58 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -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);