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: <20260106153646.23280-4-sunlightlinux@gmail.com>
Date: Tue,  6 Jan 2026 17:36:48 +0200
From: "Ionut Nechita (Sunlight Linux)" <sunlightlinux@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>,
	Frederic Weisbecker <frederic@...nel.org>,
	Ingo Molnar <mingo@...nel.org>,
	Anna-Maria Behnsen <anna-maria@...utronix.de>,
	Ionut Nechita <ionut_n2001@...oo.com>
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH 1/1] tick/nohz: Add fast-path tick stopping for idle isolated cores

From: Ionut Nechita <ionut_n2001@...oo.com>

When a CPU is configured as nohz_full and is running the idle task with
no tick dependencies, we can skip expensive dependency checks and
immediately allow the tick to stop. This significantly reduces timer
interrupts on properly isolated cores.

The patch adds:
1. Prefetching of dependency structures for better cache locality
2. Fast-path optimization for idle isolated cores with no dependencies

This benefits real-time workloads and latency-sensitive applications
by minimizing timer interrupt overhead on isolated CPUs.

Benchmark results show isolated CPUs can achieve <500 LOC (Local timer)
interrupts with this optimization, compared to ~8K without it, with
best-case scenarios achieving <125 LOC interrupts on well-configured
systems.

Signed-off-by: Ionut Nechita <ionut_n2001@...oo.com>
---
 kernel/time/tick-sched.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index b344fff613546..98391da485e2a 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -384,6 +384,29 @@ static bool can_stop_full_tick(int cpu, struct tick_sched *ts)
 {
 	lockdep_assert_irqs_disabled();
 
+	/*
+	 * Prefetch dependency structures for better cache locality
+	 */
+	prefetch(&tick_dep_mask);
+	prefetch(&ts->tick_dep_mask);
+	prefetch(&current->tick_dep_mask);
+	prefetch(&current->signal->tick_dep_mask);
+
+	/*
+	 * Fast path for idle isolated cores: if this is an isolated CPU
+	 * running the idle task with no dependencies, we can skip expensive
+	 * checks and immediately allow tick to stop. This significantly
+	 * reduces timer interrupts on properly isolated cores.
+	 */
+	if (tick_nohz_full_cpu(cpu) &&
+	    is_idle_task(current) &&
+	    !atomic_read(&tick_dep_mask) &&
+	    !atomic_read(&ts->tick_dep_mask) &&
+	    !atomic_read(&current->tick_dep_mask) &&
+	    !atomic_read(&current->signal->tick_dep_mask)) {
+		return true;
+	}
+
 	if (unlikely(!cpu_online(cpu)))
 		return false;
 
-- 
2.52.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ