Skip to content

Commit 860fa3f

Browse files
joelagnelpaulmckrcu
authored andcommitted
rcu/rcutorture: Use call_rcu_flush() where needed
call_rcu() changes to save power will change the behavior of rcutorture tests. Use the call_rcu_flush() API instead which reverts to the old behavior. Reported-by: Paul E. McKenney <[email protected]> Signed-off-by: Joel Fernandes (Google) <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent e0d78e0 commit 860fa3f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

kernel/rcu/rcutorture.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ static unsigned long rcu_no_completed(void)
510510

511511
static void rcu_torture_deferred_free(struct rcu_torture *p)
512512
{
513-
call_rcu(&p->rtort_rcu, rcu_torture_cb);
513+
call_rcu_flush(&p->rtort_rcu, rcu_torture_cb);
514514
}
515515

516516
static void rcu_sync_torture_init(void)
@@ -551,7 +551,7 @@ static struct rcu_torture_ops rcu_ops = {
551551
.start_gp_poll_exp_full = start_poll_synchronize_rcu_expedited_full,
552552
.poll_gp_state_exp = poll_state_synchronize_rcu,
553553
.cond_sync_exp = cond_synchronize_rcu_expedited,
554-
.call = call_rcu,
554+
.call = call_rcu_flush,
555555
.cb_barrier = rcu_barrier,
556556
.fqs = rcu_force_quiescent_state,
557557
.stats = NULL,
@@ -848,7 +848,7 @@ static void rcu_tasks_torture_deferred_free(struct rcu_torture *p)
848848

849849
static void synchronize_rcu_mult_test(void)
850850
{
851-
synchronize_rcu_mult(call_rcu_tasks, call_rcu);
851+
synchronize_rcu_mult(call_rcu_tasks, call_rcu_flush);
852852
}
853853

854854
static struct rcu_torture_ops tasks_ops = {
@@ -3388,13 +3388,13 @@ static void rcu_test_debug_objects(void)
33883388
/* Try to queue the rh2 pair of callbacks for the same grace period. */
33893389
preempt_disable(); /* Prevent preemption from interrupting test. */
33903390
rcu_read_lock(); /* Make it impossible to finish a grace period. */
3391-
call_rcu(&rh1, rcu_torture_leak_cb); /* Start grace period. */
3391+
call_rcu_flush(&rh1, rcu_torture_leak_cb); /* Start grace period. */
33923392
local_irq_disable(); /* Make it harder to start a new grace period. */
3393-
call_rcu(&rh2, rcu_torture_leak_cb);
3394-
call_rcu(&rh2, rcu_torture_err_cb); /* Duplicate callback. */
3393+
call_rcu_flush(&rh2, rcu_torture_leak_cb);
3394+
call_rcu_flush(&rh2, rcu_torture_err_cb); /* Duplicate callback. */
33953395
if (rhp) {
3396-
call_rcu(rhp, rcu_torture_leak_cb);
3397-
call_rcu(rhp, rcu_torture_err_cb); /* Another duplicate callback. */
3396+
call_rcu_flush(rhp, rcu_torture_leak_cb);
3397+
call_rcu_flush(rhp, rcu_torture_err_cb); /* Another duplicate callback. */
33983398
}
33993399
local_irq_enable();
34003400
rcu_read_unlock();

0 commit comments

Comments
 (0)