From nobody Mon May 25 00:09:08 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 239F73C76BB; Wed, 20 May 2026 08:34:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779266059; cv=none; b=MlMSYICrCDsA9NEu0Dof6qnCJVIMs674KEYS0Zqsa/X3/sfLhkfN88y35byYuiTOJtG94zGC3Y+YSO1mkrSuEGj3b0LxYuOowp/vR6dPADCm2AqJ+Uy1sPudGDYvqVByrEyCOQ6Aua+CpUD5U8ULNinVKHbaBdp1XtPV600mKO8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779266059; c=relaxed/simple; bh=ZJXcHQXGnIkHCBJwbQTKnr4CMUZtwh+bLgUnl32m6sE=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=RvLC41ywDHtQFk7EvPvOnOpBlZITtFlCxfayakPrZXRuuZnI/zpx3XPNMZfvdG2VB1XfkcBZNYKz9RpU+SWNumNKJtJYWzuIsP1pNj++ZnjfqmMHks4Vd4mNF3pDalUMmrcyKMDvoIZGlIXDhhH5IrYexKYMscqGM7UY7l8Wg4w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=2Lg5lHhe; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=WnJuOqYl; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2Lg5lHhe"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="WnJuOqYl" Date: Wed, 20 May 2026 08:34:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779266056; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5eug3IQ20/V6OfXHvV2frIc2WtgMfKLUVseExSh5OL4=; b=2Lg5lHhenLUENO4ybJ5EnoRdmB4oFP7D+NcoDSy228AFuPy2Lb60o8ThA+cO/slc0JLB/8 Ytd0+z4/TMy/KTlmqxoORIiMoDyCvLlTyE3nSQsZVKX1bDniX3Tjk5N0UZiZneFy7UwUfK 5VMjD6Xvpz3LFO9mimgq+8Tl7jtNsStT/IoKtxmzVaktushx+nflPUK994pGleh+GyeNS2 U93xZwOLvHddZ9K3hAVSM8cAyCG6QA3Bakqzsmi7e8NvTyv3b6xvKfVw09xf1KCnJ9PqvG E4UWH40GveARKc3SI+rLHTHEz5N8iLNwUrTgUN6SJg9H5v/CG2TwpS0MmjJEhQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779266056; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5eug3IQ20/V6OfXHvV2frIc2WtgMfKLUVseExSh5OL4=; b=WnJuOqYlAPZzg25jpxt2zjGDb+cyeCQ//yZ3MYBewnif4UyyMIsQr5sUmz5sEKbRfkr0B9 jUyKJBSeqhrbt7DQ== From: "tip-bot2 for Nicolas Pitre" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/cputime: Drop now-stale mul_u64_u64_div_u64() over-approximation guard Cc: Nicolas Pitre , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260514202629.673539-1-nico@fluxnic.net> References: <20260514202629.673539-1-nico@fluxnic.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177926605507.711.12070196415575665227.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the sched/core branch of tip: Commit-ID: 95f44886afec7cbce0ff2a5ed8158fbe8aa6f2ec Gitweb: https://git.kernel.org/tip/95f44886afec7cbce0ff2a5ed8158fbe8= aa6f2ec Author: Nicolas Pitre AuthorDate: Thu, 14 May 2026 16:26:29 -04:00 Committer: Peter Zijlstra CommitterDate: Tue, 19 May 2026 12:17:35 +02:00 sched/cputime: Drop now-stale mul_u64_u64_div_u64() over-approximation guard Commit 77baa5bafcbe ("sched/cputime: Fix mul_u64_u64_div_u64() precision for cputime") added a clamp in cputime_adjust(): if (unlikely(stime > rtime)) stime =3D rtime; The justification was that mul_u64_u64_div_u64() could over-approximate on some architectures (notably arm64 and the old 32-bit fallback), so the mathematically impossible stime > rtime was nevertheless reachable and would underflow utime =3D rtime - stime. That premise no longer holds. Commit b29a62d87cc0 ("mul_u64_u64_div_u64: make it precise always") replaced the fallback implementation with an exact 128-bit long division, and the x86_64 inline asm already produced exact results. The helper now returns the mathematically correct floor(a*b/d) on every architecture, so stime <=3D rtime is guaranteed by stime <=3D stime + utime and the clamp is dead code. Remove it along with its stale comment. Signed-off-by: Nicolas Pitre Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260514202629.673539-1-nico@fluxnic.net --- kernel/sched/cputime.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index fbf31db..6e85023 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -587,12 +587,6 @@ void cputime_adjust(struct task_cputime *curr, struct = prev_cputime *prev, } =20 stime =3D mul_u64_u64_div_u64(stime, rtime, stime + utime); - /* - * Because mul_u64_u64_div_u64() can approximate on some - * achitectures; enforce the constraint that: a*b/(b+c) <=3D a. - */ - if (unlikely(stime > rtime)) - stime =3D rtime; =20 update: /*