diff options
author | Antti P Miettinen <ananaza@iki.fi> | 2012-10-05 02:59:15 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-10-23 17:54:08 -0400 |
commit | 3705b88db0d7cc4a097c32d9e554054103d3f807 (patch) | |
tree | f3baf8c94363506964c9f944496267f74cdee47c /kernel/srcu.c | |
parent | ba49df4767d4fa5bbd2af3a51709fb81f94264ec (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/srcu.c')
-rw-r--r-- | kernel/srcu.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/srcu.c b/kernel/srcu.c index 97c465ebd844..de9074047c92 100644 --- a/kernel/srcu.c +++ b/kernel/srcu.c | |||
@@ -34,6 +34,10 @@ | |||
34 | #include <linux/delay.h> | 34 | #include <linux/delay.h> |
35 | #include <linux/srcu.h> | 35 | #include <linux/srcu.h> |
36 | 36 | ||
37 | #include <trace/events/rcu.h> | ||
38 | |||
39 | #include "rcu.h" | ||
40 | |||
37 | /* | 41 | /* |
38 | * Initialize an rcu_batch structure to empty. | 42 | * Initialize an rcu_batch structure to empty. |
39 | */ | 43 | */ |
@@ -464,7 +468,9 @@ static void __synchronize_srcu(struct srcu_struct *sp, int trycount) | |||
464 | */ | 468 | */ |
465 | void synchronize_srcu(struct srcu_struct *sp) | 469 | void synchronize_srcu(struct srcu_struct *sp) |
466 | { | 470 | { |
467 | __synchronize_srcu(sp, SYNCHRONIZE_SRCU_TRYCOUNT); | 471 | __synchronize_srcu(sp, rcu_expedited |
472 | ? SYNCHRONIZE_SRCU_EXP_TRYCOUNT | ||
473 | : SYNCHRONIZE_SRCU_TRYCOUNT); | ||
468 | } | 474 | } |
469 | EXPORT_SYMBOL_GPL(synchronize_srcu); | 475 | EXPORT_SYMBOL_GPL(synchronize_srcu); |
470 | 476 | ||