aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree.c
diff options
context:
space:
mode:
authorAntti P Miettinen <ananaza@iki.fi>2012-10-05 02:59:15 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-10-23 17:54:08 -0400
commit3705b88db0d7cc4a097c32d9e554054103d3f807 (patch)
treef3baf8c94363506964c9f944496267f74cdee47c /kernel/rcutree.c
parentba49df4767d4fa5bbd2af3a51709fb81f94264ec (diff)
rcu: Add a module parameter to force use of expedited RCU primitives
There have been some embedded applications that would benefit from use of expedited grace-period primitives. In some ways, this is similar to synchronize_net() doing either a normal or an expedited grace period depending on lock state, but with control outside of the kernel. This commit therefore adds rcu_expedited boot and sysfs parameters that cause the kernel to substitute expedited primitives for the normal grace-period primitives. [ paulmck: Add trace/event/rcu.h to kernel/srcu.c to avoid build error. Get rid of infinite loop through contention path.] Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r--kernel/rcutree.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 74df86bd9204..f9c17c399538 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -2224,7 +2224,10 @@ void synchronize_sched(void)
2224 "Illegal synchronize_sched() in RCU-sched read-side critical section"); 2224 "Illegal synchronize_sched() in RCU-sched read-side critical section");
2225 if (rcu_blocking_is_gp()) 2225 if (rcu_blocking_is_gp())
2226 return; 2226 return;
2227 wait_rcu_gp(call_rcu_sched); 2227 if (rcu_expedited)
2228 synchronize_sched_expedited();
2229 else
2230 wait_rcu_gp(call_rcu_sched);
2228} 2231}
2229EXPORT_SYMBOL_GPL(synchronize_sched); 2232EXPORT_SYMBOL_GPL(synchronize_sched);
2230 2233
@@ -2245,7 +2248,10 @@ void synchronize_rcu_bh(void)
2245 "Illegal synchronize_rcu_bh() in RCU-bh read-side critical section"); 2248 "Illegal synchronize_rcu_bh() in RCU-bh read-side critical section");
2246 if (rcu_blocking_is_gp()) 2249 if (rcu_blocking_is_gp())
2247 return; 2250 return;
2248 wait_rcu_gp(call_rcu_bh); 2251 if (rcu_expedited)
2252 synchronize_rcu_bh_expedited();
2253 else
2254 wait_rcu_gp(call_rcu_bh);
2249} 2255}
2250EXPORT_SYMBOL_GPL(synchronize_rcu_bh); 2256EXPORT_SYMBOL_GPL(synchronize_rcu_bh);
2251 2257
@@ -2328,7 +2334,7 @@ void synchronize_sched_expedited(void)
2328 if (trycount++ < 10) { 2334 if (trycount++ < 10) {
2329 udelay(trycount * num_online_cpus()); 2335 udelay(trycount * num_online_cpus());
2330 } else { 2336 } else {
2331 synchronize_sched(); 2337 wait_rcu_gp(call_rcu_sched);
2332 return; 2338 return;
2333 } 2339 }
2334 2340