lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <176979052132.2495410.7439244707384438738.tip-bot2@tip-bot2>
Date: Fri, 30 Jan 2026 16:28:41 -0000
From: "tip-bot2 for Ionut Nechita (Sunlight Linux)" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Thomas Gleixner <tglx@...utronix.de>,
 "Ionut Nechita (Sunlight Linux)" <sunlightlinux@...il.com>,
 Thomas Gleixner <tglx@...nel.org>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject: [tip: timers/core] tick/nohz: Optimize check_tick_dependency() with
 early return

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     9328c0960f22e2499319e4e894abb98aa0f9d222
Gitweb:        https://git.kernel.org/tip/9328c0960f22e2499319e4e894abb98aa0f9d222
Author:        Ionut Nechita (Sunlight Linux) <sunlightlinux@...il.com>
AuthorDate:    Wed, 28 Jan 2026 09:45:43 +02:00
Committer:     Thomas Gleixner <tglx@...nel.org>
CommitterDate: Fri, 30 Jan 2026 17:24:31 +01:00

tick/nohz: Optimize check_tick_dependency() with early return

There is no point in iterating through individual tick dependency bits when
the tick_stop tracepoint is disabled, which is the common case.

When the trace point is disabled, return immediately based on the atomic
value being zero or non-zero, skipping the per-bit evaluation.

This optimization improves the hot path performance of tick dependency
checks across all contexts (idle and non-idle), not just nohz_full CPUs.

Suggested-by: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: Ionut Nechita (Sunlight Linux) <sunlightlinux@...il.com>
Signed-off-by: Thomas Gleixner <tglx@...nel.org>
Link: https://patch.msgid.link/20260128074558.15433-3-sunlightlinux@gmail.com
---
 kernel/time/tick-sched.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 8ddf74e..fd928d3 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -344,6 +344,9 @@ static bool check_tick_dependency(atomic_t *dep)
 {
 	int val = atomic_read(dep);
 
+	if (likely(!tracepoint_enabled(tick_stop)))
+		return !val;
+
 	if (val & TICK_DEP_MASK_POSIX_TIMER) {
 		trace_tick_stop(0, TICK_DEP_MASK_POSIX_TIMER);
 		return true;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ