From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=193.142.43.55 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796051533; b=CHpr0+WUkeVfFm9bAUVU3XayijvkpXojHESODSf4QEfxhiFuoiGB9Yz37ck1gRzXKd/m HT3u0VSND8pTlcBmS+DhlOxgvM+8G2LzROSL80CGkmCO0MuofqsuGsubquvs3vqcEQfYU C1Uri77gJNqH1ZuRxpghup/GinreH/1phMuII5s4KEpyF+Flvo4qrMiZPVsW9xn6G2VoM QijVo7cb2Gytr70JeyKbQvEJzVF7pcEArjjmyoX4f7idEoW6LqQfdaN//d6qs2mDjh+oM mcD15bNbIs5FxVGMEJaXRQO8z0X6IYtzbv0HM6N3JrLw2uVLWyEYTypatWYqJl3DHaw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796051533; h=DMARC-Filter:Date:DKIM-Signature:DKIM-Signature:From:Sender:Reply-to: To:Subject:Cc:In-Reply-To:References:MIME-Version:Message-ID:Robot-ID: Robot-Unsubscribe:Precedence:Content-Type:Content-Transfer-Encoding; bh=CfnxU02fchWfASqdRBVSNgIHEe5ugt21dy5hEeki6/M=; b=fXZlbC8Xah4beOrYKmglT/rBfi2UgSnb3WPGYSPftq2C/Xp8iqaEjQdMNeTXiUr3zWLM FYG7pSYPDy4jpQozjytOGRhhSyttyJI967HGXXXTktBs+JlB8IuGoUyjH0tU0CkLZ6hg8 pYDeTvaeeTRR9YgBSePSoFIM5LsWIKvroPUECuVMGDywWMzKYjgcJBARVKkgay9CaQc2m Bb3lpkc6gsx18uGjj+aoOLH7f0UJ/z9yBfpv9qrjv1q61KtadqsNWJIG9kbMP19x/ZECQ 3w1wnAZOEQbgX02LJR6Y/EyeR84J9aPfmKEIMGnSYEnKaXzkeTOoIY1x7PRo6ps7F5w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b="Z/jn2z9x"; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=B2PzXgHK; arc=none smtp.remote-ip=193.142.43.55 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C649C606A332; Mon, 30 Nov 2026 15:12:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C649C606A332 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.a=rsa-sha256 header.s=2020 header.b=Z/jn2z9x; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=B2PzXgHK Date: Mon, 30 Nov 2026 15:12:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1796051531; 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=CfnxU02fchWfASqdRBVSNgIHEe5ugt21dy5hEeki6/M=; b=Z/jn2z9x1JkLCjq/mcYFXeis/WZaZe22hEH4YpQr5bJJOPBsHy8UBpnUHLSSbwIWVSzMLV xVqIAao0fO+uCCya5dEJzCrvXNNwE65W/T7YD0XWwjZQf8+gmr8V1XnlZp+rff3aZHkLbs FiQc9g16cZYzIUHQAyh0T6+3VSIRSLJdsOsJF7EzU+wCePXuenKZTmEDaFxfOrb0zJnwPe 7SSy+4gLkl5p8zFMZ1YbDC1MdQ5t7CYy+DWu4t6NE4NZFSrNBx+xC8d4ecpzd9oQU323sE QSuawesGgZDL369rNS2EJ5gPCpbbqzzL8xFJXOjOqhJtpJETXVtFC+Hq2iXyDA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1796051531; 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=CfnxU02fchWfASqdRBVSNgIHEe5ugt21dy5hEeki6/M=; b=B2PzXgHKlqzIpfKU8MK5dm4vf5FTzcDDH6pP4ljrFZD50u98+fZDzyNJLWENSXRRMf2PiD kfL0hSY9CAJ3dtCg== From: tip-bot2 for Thomas =?utf-8?q?Wei=C3=9Fschuh_=28Schneider_Electric=29?= Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] time: test: Avoid unnecessary divisions in time64_to_tm() test Cc: thomas.weissschuh@linutronix.de, Thomas Gleixner , Cassio Neri , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20261130-time-time64-to-tm-v3-2-f68748ad4118@linutronix.de> References: <20261130-time-time64-to-tm-v3-2-f68748ad4118@linutronix.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-ID: <179605152937.1190409.12336921388218092124.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 timers/core branch of tip: Commit-ID: ca365417bd492e605e21820730b63bc77dc8c7dc Gitweb: https://git.kernel.org/tip/ca365417bd492e605e21820730b63bc77dc= 8c7dc Author: Thomas Wei=C3=9Fschuh (Schneider Electric) AuthorDate: Mon, 30 Nov 2026 15:20:48 +01:00 Committer: Thomas Gleixner CommitterDate: Mon, 30 Nov 2026 16:08:42 +01:00 time: test: Avoid unnecessary divisions in time64_to_tm() test The time64_to_tm_test_date_range() test case is slow. One big part of this slowness is the division done in the test loop to calculate the current day from the current seconds. As each test loop advances the time by one day, that division can be avoided. Remove the division and instead increment the 'days' variable directly. This brings the test's runtime from 30 seconds down to 15 seconds in an emulated 32-bit ARM machine. Signed-off-by: Thomas Wei=C3=9Fschuh (Schneider Electric) Signed-off-by: Thomas Gleixner Reviewed-by: Cassio Neri Link: https://patch.msgid.link/20261130-time-time64-to-tm-v3-2-f68748ad4118@l= inutronix.de --- kernel/time/time_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/time/time_test.c b/kernel/time/time_test.c index 8b71876..41e504a 100644 --- a/kernel/time/time_test.c +++ b/kernel/time/time_test.c @@ -69,12 +69,12 @@ static void time64_to_tm_test_date_range(struct kunit *te= st) time64_t secs; s64 days; =20 - for (secs =3D -total_secs; secs <=3D total_secs; secs +=3D 86400) { + for (secs =3D -total_secs, days =3D div_s64(secs, 86400); + secs <=3D total_secs; + secs +=3D 86400, days++) { =20 time64_to_tm(secs, 0, &result); =20 - days =3D div_s64(secs, 86400); - #define FAIL_MSG "%05ld/%02d/%02d (%2d) : %lld", \ year, month, mdday, yday, days =20