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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190802151501.13069-14-paulmck@linux.ibm.com>
Date:   Fri,  2 Aug 2019 08:15:01 -0700
From:   "Paul E. McKenney" <paulmck@...ux.ibm.com>
To:     rcu@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, mingo@...nel.org,
        jiangshanlai@...il.com, dipankar@...ibm.com,
        akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
        josh@...htriplett.org, tglx@...utronix.de, peterz@...radead.org,
        rostedt@...dmis.org, dhowells@...hat.com, edumazet@...gle.com,
        fweisbec@...il.com, oleg@...hat.com, joel@...lfernandes.org,
        "Paul E. McKenney" <paulmck@...ux.ibm.com>
Subject: [PATCH RFC tip/core/rcu 14/14] rcu/nohz: Make multi_cpu_stop() enable tick on all online CPUs

The multi_cpu_stop() function relies on the scheduler to gain control from
whatever is running on the various online CPUs, including any nohz_full
CPUs running long loops in kernel-mode code.  Lack of the scheduler-clock
interrupt on such CPUs can delay multi_cpu_stop() for several minutes
and can also result in RCU CPU stall warnings.  This commit therefore
causes multi_cpu_stop() to enable the scheduler-clock interrupt on all
online CPUs.

Signed-off-by: Paul E. McKenney <paulmck@...ux.ibm.com>
---
 kernel/stop_machine.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index b4f83f7bdf86..a2659f61ed92 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -20,6 +20,7 @@
 #include <linux/smpboot.h>
 #include <linux/atomic.h>
 #include <linux/nmi.h>
+#include <linux/tick.h>
 #include <linux/sched/wake_q.h>
 
 /*
@@ -187,15 +188,19 @@ static int multi_cpu_stop(void *data)
 {
 	struct multi_stop_data *msdata = data;
 	enum multi_stop_state curstate = MULTI_STOP_NONE;
-	int cpu = smp_processor_id(), err = 0;
+	int cpu, err = 0;
 	const struct cpumask *cpumask;
 	unsigned long flags;
 	bool is_active;
 
+	for_each_online_cpu(cpu)
+		tick_nohz_dep_set_cpu(cpu, TICK_DEP_MASK_RCU);
+
 	/*
 	 * When called from stop_machine_from_inactive_cpu(), irq might
 	 * already be disabled.  Save the state and restore it on exit.
 	 */
+	cpu = smp_processor_id();
 	local_save_flags(flags);
 
 	if (!msdata->active_cpus) {
@@ -236,6 +241,8 @@ static int multi_cpu_stop(void *data)
 	} while (curstate != MULTI_STOP_EXIT);
 
 	local_irq_restore(flags);
+	for_each_online_cpu(cpu)
+		tick_nohz_dep_clear_cpu(cpu, TICK_DEP_MASK_RCU);
 	return err;
 }
 
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ