aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree_plugin.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paul.mckenney@linaro.org>2011-04-14 15:13:53 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2011-05-06 02:16:55 -0400
commit0f962a5e7277c34987b77dc82fc9aefcedc95e27 (patch)
treeb265d93dcc8f2669f8fb9b353344b9f6cc354728 /kernel/rcutree_plugin.h
parent27f4d28057adf98750cf863c40baefb12f5b6d21 (diff)
rcu: Force per-rcu_node kthreads off of the outgoing CPU
The scheduler has had some heartburn in the past when too many real-time kthreads were affinitied to the outgoing CPU. So, this commit lightens the load by forcing the per-rcu_node and the boost kthreads off of the outgoing CPU. Note that RCU's per-CPU kthread remains on the outgoing CPU until the bitter end, as it must in order to preserve correctness. Also avoid disabling hardirqs across calls to set_cpus_allowed_ptr(), given that this function can block. Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcutree_plugin.h')
-rw-r--r--kernel/rcutree_plugin.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index 5964f82e2d96..4e486255df63 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -1212,17 +1212,19 @@ static void rcu_initiate_boost(struct rcu_node *rnp)
1212 } 1212 }
1213} 1213}
1214 1214
1215/*
1216 * Set the affinity of the boost kthread. The CPU-hotplug locks are
1217 * held, so no one should be messing with the existence of the boost
1218 * kthread.
1219 */
1215static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp, 1220static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp,
1216 cpumask_var_t cm) 1221 cpumask_var_t cm)
1217{ 1222{
1218 unsigned long flags;
1219 struct task_struct *t; 1223 struct task_struct *t;
1220 1224
1221 raw_spin_lock_irqsave(&rnp->lock, flags);
1222 t = rnp->boost_kthread_task; 1225 t = rnp->boost_kthread_task;
1223 if (t != NULL) 1226 if (t != NULL)
1224 set_cpus_allowed_ptr(rnp->boost_kthread_task, cm); 1227 set_cpus_allowed_ptr(rnp->boost_kthread_task, cm);
1225 raw_spin_unlock_irqrestore(&rnp->lock, flags);
1226} 1228}
1227 1229
1228#define RCU_BOOST_DELAY_JIFFIES DIV_ROUND_UP(CONFIG_RCU_BOOST_DELAY * HZ, 1000) 1230#define RCU_BOOST_DELAY_JIFFIES DIV_ROUND_UP(CONFIG_RCU_BOOST_DELAY * HZ, 1000)