Skip to content

Commit 47aa8b6

Browse files
committed
nohz: Reduce overhead under high-freq idling patterns
One testbox of mine (Intel Nehalem, 16-way) uses MWAIT for its idle routine, which apparently can break out of its idle loop rather frequently, with high frequency. In that case NO_HZ_FULL=y kernels show high ksoftirqd overhead and constant context switching, because tick_nohz_stop_sched_tick() will, if delta_jiffies == 0, mis-identify this as a timer event - activating the TIMER_SOFTIRQ, which wakes up ksoftirqd. Fix this by treating delta_jiffies == 0 the same way we treat other short wakeups, delta_jiffies == 1. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Chris Metcalf <cmetcalf@tilera.com> Cc: Christoph Lameter <cl@linux.com> Cc: Geoff Levand <geoff@infradead.org> Cc: Gilad Ben Yossef <gilad@benyossef.com> Cc: Hakan Akkan <hakanakkan@gmail.com> Cc: Kevin Hilman <khilman@linaro.org> Cc: Li Zhong <zhong@linux.vnet.ibm.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 65e709d commit 47aa8b6

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎kernel/time/tick-sched.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -565,11 +565,12 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
565565
delta_jiffies = rcu_delta_jiffies;
566566
}
567567
}
568+
568569
/*
569-
* Do not stop the tick, if we are only one off
570-
* or if the cpu is required for rcu
570+
* Do not stop the tick, if we are only one off (or less)
571+
* or if the cpu is required for RCU:
571572
*/
572-
if (!ts->tick_stopped && delta_jiffies == 1)
573+
if (!ts->tick_stopped && delta_jiffies <= 1)
573574
goto out;
574575

575576
/* Schedule the tick, if we are at least one jiffie off */

0 commit comments

Comments
 (0)