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>
This commit is contained in:
parent
751a68b2e4
commit
e3f8d3788e
@ -635,6 +635,17 @@ static void srcu_torture_synchronize(void)
|
|||||||
synchronize_srcu(&srcu_ctl);
|
synchronize_srcu(&srcu_ctl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void srcu_torture_call(struct rcu_head *head,
|
||||||
|
void (*func)(struct rcu_head *head))
|
||||||
|
{
|
||||||
|
call_srcu(&srcu_ctl, head, func);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void srcu_torture_barrier(void)
|
||||||
|
{
|
||||||
|
srcu_barrier(&srcu_ctl);
|
||||||
|
}
|
||||||
|
|
||||||
static int srcu_torture_stats(char *page)
|
static int srcu_torture_stats(char *page)
|
||||||
{
|
{
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
@ -661,8 +672,8 @@ static struct rcu_torture_ops srcu_ops = {
|
|||||||
.completed = srcu_torture_completed,
|
.completed = srcu_torture_completed,
|
||||||
.deferred_free = srcu_torture_deferred_free,
|
.deferred_free = srcu_torture_deferred_free,
|
||||||
.sync = srcu_torture_synchronize,
|
.sync = srcu_torture_synchronize,
|
||||||
.call = NULL,
|
.call = srcu_torture_call,
|
||||||
.cb_barrier = NULL,
|
.cb_barrier = srcu_torture_barrier,
|
||||||
.stats = srcu_torture_stats,
|
.stats = srcu_torture_stats,
|
||||||
.name = "srcu"
|
.name = "srcu"
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user