[PATCH v2 5/5] nohz: cpu_isolated: allow tick to be fully disabled

From: Chris Metcalf
Date: Fri May 15 2015 - 17:28:33 EST


While the current fallback to 1-second tick is still helpful for
maintaining completely correct kernel semantics, processes using
prctl(PR_SET_CPU_ISOLATED) semantics place a higher priority on running
completely tickless, so don't bound the time_delta for such processes.

This was previously discussed in

https://lkml.org/lkml/2014/10/31/364

and Thomas Gleixner observed that vruntime, load balancing data,
load accounting, and other things might be impacted. Frederic
Weisbecker similarly observed that allowing the tick to be indefinitely
deferred just meant that no one would ever fix the underlying bugs.
However it's at least true that the mode proposed in this patch can
only be enabled on an isolcpus core, which may limit how important
it is to maintain scheduler data correctly, for example.

It's also worth observing that the tile architecture has been using
similar code for its Zero-Overhead Linux for many years (starting in
2005) and customers are very enthusiastic about the resulting bare-metal
performance on cores that are available to run full Linux semantics
on demand (crash, logging, shutdown, etc). So this semantics is very
useful if we can convince ourselves that doing this is safe.

Signed-off-by: Chris Metcalf <cmetcalf@xxxxxxxxxx>
---
Note: I have kept this in the series despite PeterZ's nack, since it
didn't seem resolved in the original thread from v1 of the patch
(https://lkml.org/lkml/2015/5/8/555).

kernel/time/tick-sched.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 772be78f926c..be4db5d81ada 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -727,7 +727,7 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
}

#ifdef CONFIG_NO_HZ_FULL
- if (!ts->inidle) {
+ if (!ts->inidle && !tick_nohz_is_cpu_isolated()) {
time_delta = min(time_delta,
scheduler_tick_max_deferment());
}
--
2.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/