linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* nohz: ignore explicit nohz=off in case of nohz_full running
@ 2018-11-12  9:03 zhengchuan
  0 siblings, 0 replies; only message in thread
From: zhengchuan @ 2018-11-12  9:03 UTC (permalink / raw)
  To: fweisbec, tglx, mingo, linux-kernel
  Cc: Tangchen (UVP), gaowanlong, Wencongyang (UVP), Wanghui (John),
	guijianfeng

Hi,
It seems "nohz=" is not compatible with "nohz_full=" or "isolcpus=" by now.
when both "nohz=off" and "nohz_full=[cpulist]" or "isolcpus=nohz,domain" is configured in cmdline, 
we enter an ambiguous status, that is, we do unbound timers, watchdog, RCU isolation, even show nohz_full cpu in sysfs, 
but we never enter tickless mode because one-shot mode is disable by "nohz=off" in tick_nohz_switch_to_nohz().

**************
[How I resolve it]
**************
Since we want to centralize the isolation management by housekeeping subsystem, we regard "nohz_full=" or "isolcpus=" as the controller.
Just ignore explicit nohz=off when nohz_full=[cpulist] or isolcpus=nohz,domain is configured.
---
 kernel/time/tick-sched.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 5b33e2f..d30d783 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -414,6 +414,8 @@ void __init tick_nohz_init(void)
        if (!tick_nohz_full_running)
                return;

+       if (!tick_nohz_enabled)
+               pr_warn("NO_HZ: NOHZ is disable explicitly, ignore it in case of NOHZ_FULL running\n");
        /*
         * Full dynticks uses irq work to drive the tick rescheduling on safe
         * locking contexts. But then we need irq work to raise its own @@ -1182,7 +1184,7 @@ static void tick_nohz_handler(struct clock_event_device *dev)

 static inline void tick_nohz_activate(struct tick_sched *ts, int mode)  {
-       if (!tick_nohz_enabled)
+       if (!tick_nohz_enabled && !tick_nohz_full_enabled())
                return;
        ts->nohz_mode = mode;
        /* One update is enough */
@@ -1198,7 +1200,7 @@ static void tick_nohz_switch_to_nohz(void)
        struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched);
        ktime_t next;

-       if (!tick_nohz_enabled)
+       if (!tick_nohz_enabled && !tick_nohz_full_enabled())
                return;

        if (tick_switch_to_oneshot(tick_nohz_handler))
--
1.7.12.4

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-11-12  9:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-12  9:03 nohz: ignore explicit nohz=off in case of nohz_full running zhengchuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).