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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <0E8924944E28FD4A97A19E5A680D8A822DF0AF28@DGGEML521-MBX.china.huawei.com>
Date:   Mon, 12 Nov 2018 09:03:12 +0000
From:   zhengchuan <zhengchuan@...wei.com>
To:     "fweisbec@...il.com" <fweisbec@...il.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...nel.org" <mingo@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:     "Tangchen (UVP)" <tang.chen@...wei.com>,
        gaowanlong <gaowanlong@...wei.com>,
        "Wencongyang (UVP)" <wencongyang2@...wei.com>,
        "Wanghui (John)" <john.wanghui@...wei.com>,
        guijianfeng <guijianfeng@...wei.com>
Subject: nohz: ignore explicit nohz=off in case of nohz_full running

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ