Skip to content

Commit dcb5036

Browse files
joelagnelchantra
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 b02352d commit dcb5036

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
@@ -514,7 +514,7 @@ static unsigned long rcu_no_completed(void)
514514

515515
static void rcu_torture_deferred_free(struct rcu_torture *p)
516516
{
517-
call_rcu(&p->rtort_rcu, rcu_torture_cb);
517+
call_rcu_flush(&p->rtort_rcu, rcu_torture_cb);
518518
}
519519

520520
static void rcu_sync_torture_init(void)
@@ -559,7 +559,7 @@ static struct rcu_torture_ops rcu_ops = {
559559
.start_gp_poll_exp_full = start_poll_synchronize_rcu_expedited_full,
560560
.poll_gp_state_exp = poll_state_synchronize_rcu,
561561
.cond_sync_exp = cond_synchronize_rcu_expedited,
562-
.call = call_rcu,
562+
.call = call_rcu_flush,
563563
.cb_barrier = rcu_barrier,
564564
.fqs = rcu_force_quiescent_state,
565565
.stats = NULL,
@@ -863,7 +863,7 @@ static void rcu_tasks_torture_deferred_free(struct rcu_torture *p)
863863

864864
static void synchronize_rcu_mult_test(void)
865865
{
866-
synchronize_rcu_mult(call_rcu_tasks, call_rcu);
866+
synchronize_rcu_mult(call_rcu_tasks, call_rcu_flush);
867867
}
868868

869869
static struct rcu_torture_ops tasks_ops = {
@@ -3432,13 +3432,13 @@ static void rcu_test_debug_objects(void)
34323432
/* Try to queue the rh2 pair of callbacks for the same grace period. */
34333433
preempt_disable(); /* Prevent preemption from interrupting test. */
34343434
rcu_read_lock(); /* Make it impossible to finish a grace period. */
3435-
call_rcu(&rh1, rcu_torture_leak_cb); /* Start grace period. */
3435+
call_rcu_flush(&rh1, rcu_torture_leak_cb); /* Start grace period. */
34363436
local_irq_disable(); /* Make it harder to start a new grace period. */
3437-
call_rcu(&rh2, rcu_torture_leak_cb);
3438-
call_rcu(&rh2, rcu_torture_err_cb); /* Duplicate callback. */
3437+
call_rcu_flush(&rh2, rcu_torture_leak_cb);
3438+
call_rcu_flush(&rh2, rcu_torture_err_cb); /* Duplicate callback. */
34393439
if (rhp) {
3440-
call_rcu(rhp, rcu_torture_leak_cb);
3441-
call_rcu(rhp, rcu_torture_err_cb); /* Another duplicate callback. */
3440+
call_rcu_flush(rhp, rcu_torture_leak_cb);
3441+
call_rcu_flush(rhp, rcu_torture_err_cb); /* Another duplicate callback. */
34423442
}
34433443
local_irq_enable();
34443444
rcu_read_unlock();

0 commit comments

Comments
 (0)