lkml.org 
[lkml]   [2010]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 07/15] nohz_task: Restart tick when RCU forces nohz task cpu quiescent state
Date
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@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Anton Blanchard <anton@au1.ibm.com>
Cc: Tim Pepper <lnxninja@linux.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


\
 
 \ /
  Last update: 2010-12-20 16:27    [W:0.377 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site