aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2013-09-17 03:30:55 -0400
committerIngo Molnar <mingo@kernel.org>2013-09-25 07:53:08 -0400
commitb021fe3e25094fbec22d0eff846d2adeee1b9736 (patch)
tree6193cc7952f980625e9f77c76f650fb2a7844071 /kernel/rcutree.c
parent0c44c2d0f459cd7e275242b72f500137c4fa834d (diff)
sched, rcu: Make RCU use resched_cpu()
We're going to deprecate and remove set_need_resched() for it will do the wrong thing. Make an exception for RCU and allow it to use resched_cpu() which will do the right thing. Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Paul McKenney <paulmck@linux.vnet.ibm.com> Link: http://lkml.kernel.org/n/tip-2eywnacjl1nllctl1nszqa5w@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r--kernel/rcutree.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 32618b3fe4e6..1dc9f3604ad8 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -898,6 +898,12 @@ static void print_other_cpu_stall(struct rcu_state *rsp)
898 force_quiescent_state(rsp); /* Kick them all. */ 898 force_quiescent_state(rsp); /* Kick them all. */
899} 899}
900 900
901/*
902 * This function really isn't for public consumption, but RCU is special in
903 * that context switches can allow the state machine to make progress.
904 */
905extern void resched_cpu(int cpu);
906
901static void print_cpu_stall(struct rcu_state *rsp) 907static void print_cpu_stall(struct rcu_state *rsp)
902{ 908{
903 int cpu; 909 int cpu;
@@ -927,7 +933,14 @@ static void print_cpu_stall(struct rcu_state *rsp)
927 3 * rcu_jiffies_till_stall_check() + 3; 933 3 * rcu_jiffies_till_stall_check() + 3;
928 raw_spin_unlock_irqrestore(&rnp->lock, flags); 934 raw_spin_unlock_irqrestore(&rnp->lock, flags);
929 935
930 set_need_resched(); /* kick ourselves to get things going. */ 936 /*
937 * Attempt to revive the RCU machinery by forcing a context switch.
938 *
939 * A context switch would normally allow the RCU state machine to make
940 * progress and it could be we're stuck in kernel space without context
941 * switches for an entirely unreasonable amount of time.
942 */
943 resched_cpu(smp_processor_id());
931} 944}
932 945
933static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp) 946static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp)