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: <1292858662-5650-8-git-send-email-fweisbec@gmail.com>
Date:	Mon, 20 Dec 2010 16:24:14 +0100
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	LKML <linux-kernel@...r.kernel.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Ingo Molnar <mingo@...e.hu>,
	Steven Rostedt <rostedt@...dmis.org>,
	Lai Jiangshan <laijs@...fujitsu.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Anton Blanchard <anton@....ibm.com>,
	Tim Pepper <lnxninja@...ux.vnet.ibm.com>
Subject: [RFC PATCH 07/15] nohz_task: Restart tick when RCU forces nohz task cpu quiescent state

If a cpu is in nohz mode due to a nohz task running, then
it is not able to notify quiescent states requested by other
CPUs.

Then restart the tick to remotely force the quiescent states on the
nohz task cpus.

Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Lai Jiangshan <laijs@...fujitsu.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Anton Blanchard <anton@....ibm.com>
Cc: Tim Pepper <lnxninja@...ux.vnet.ibm.com>
---
 kernel/rcutree.c |   21 +++++++++++++++------
 kernel/sched.c   |    2 +-
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 44dce3f..ed6aba3 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -227,6 +227,8 @@ static struct rcu_node *rcu_get_root(struct rcu_state *rsp)
  */
 static int rcu_implicit_offline_qs(struct rcu_data *rdp)
 {
+	int has_nohz_task;
+
 	/*
 	 * If the CPU is offline, it is in a quiescent state.  We can
 	 * trust its state not to change because interrupts are disabled.
@@ -236,15 +238,22 @@ static int rcu_implicit_offline_qs(struct rcu_data *rdp)
 		return 1;
 	}
 
+	has_nohz_task = cpu_has_nohz_task(rdp->cpu);
+
 	/* If preemptable RCU, no point in sending reschedule IPI. */
-	if (rdp->preemptable)
+	if (rdp->preemptable && !has_nohz_task)
 		return 0;
 
-	/* The CPU is online, so send it a reschedule IPI. */
-	if (rdp->cpu != smp_processor_id())
-		smp_send_reschedule(rdp->cpu);
-	else
-		set_need_resched();
+	if (!has_nohz_task) {
+		/* The CPU is online, so send it a reschedule IPI. */
+		if (rdp->cpu != smp_processor_id())
+			smp_send_reschedule(rdp->cpu);
+		else
+			set_need_resched();
+	} else {
+		smp_send_update_nohz_task_cpu(rdp->cpu);
+	}
+
 	rdp->resched_ipi++;
 	return 0;
 }
diff --git a/kernel/sched.c b/kernel/sched.c
index 45bd6e2..b99f192 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2461,7 +2461,7 @@ static void nohz_task_cpu_update(void *unused)
 	 */
 	rq = this_rq();
 	cpu = smp_processor_id();
-	if (rq->nr_running > 1) {
+	if (rq->nr_running > 1 || rcu_pending(cpu) || rcu_needs_cpu(cpu)) {
 		__get_cpu_var(task_nohz_mode) = 0;
 		tick_nohz_restart_sched_tick();
 	}
-- 
1.7.3.2

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ