diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-05-08 13:21:50 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-07-02 15:34:03 -0400 |
commit | e3f8d3788ed7cf55946030dc9b76e73edb111602 (patch) | |
tree | c29544359df3507532eddcd141de94382af4a32a /kernel/rcutorture.c | |
parent | 751a68b2e46fe11a42450cb55a16e8065eddec7e (diff) |
rcu: Test srcu_barrier() from rcutorture test suite
SRCU now has a call_srcu() and an srcu_barrier(), but rcutorture does not
test them. This commit adds the machinery to allow rcutorture's existing
tests for call_rcu() and rcu_barrier() to apply to the SRCU equivalents.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcutorture.c')
-rw-r--r-- | kernel/rcutorture.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c index 9850479f319d..7b6935e0cee3 100644 --- a/kernel/rcutorture.c +++ b/kernel/rcutorture.c | |||
@@ -635,6 +635,17 @@ static void srcu_torture_synchronize(void) | |||
635 | synchronize_srcu(&srcu_ctl); | 635 | synchronize_srcu(&srcu_ctl); |
636 | } | 636 | } |
637 | 637 | ||
638 | static void srcu_torture_call(struct rcu_head *head, | ||
639 | void (*func)(struct rcu_head *head)) | ||
640 | { | ||
641 | call_srcu(&srcu_ctl, head, func); | ||
642 | } | ||
643 | |||
644 | static void srcu_torture_barrier(void) | ||
645 | { | ||
646 | srcu_barrier(&srcu_ctl); | ||
647 | } | ||
648 | |||
638 | static int srcu_torture_stats(char *page) | 649 | static int srcu_torture_stats(char *page) |
639 | { | 650 | { |
640 | int cnt = 0; | 651 | int cnt = 0; |
@@ -661,8 +672,8 @@ static struct rcu_torture_ops srcu_ops = { | |||
661 | .completed = srcu_torture_completed, | 672 | .completed = srcu_torture_completed, |
662 | .deferred_free = srcu_torture_deferred_free, | 673 | .deferred_free = srcu_torture_deferred_free, |
663 | .sync = srcu_torture_synchronize, | 674 | .sync = srcu_torture_synchronize, |
664 | .call = NULL, | 675 | .call = srcu_torture_call, |
665 | .cb_barrier = NULL, | 676 | .cb_barrier = srcu_torture_barrier, |
666 | .stats = srcu_torture_stats, | 677 | .stats = srcu_torture_stats, |
667 | .name = "srcu" | 678 | .name = "srcu" |
668 | }; | 679 | }; |