Skip to content

Commit 95c7d02

Browse files
paulmckrcuJoel Fernandes
authored andcommitted
rcutorture: Test call_srcu() with preemption disabled and not
This commit tests invoking call_srcu() with preemption both enabled and disabled, via acquiring of pi lock. [ Joel: reword commit message. ] Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
1 parent ab875b3 commit 95c7d02

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

kernel/rcu/rcutorture.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,14 @@ static unsigned long srcu_torture_completed(void)
842842

843843
static void srcu_torture_deferred_free(struct rcu_torture *rp)
844844
{
845+
unsigned long flags;
846+
bool lockit = jiffies & 0x1;
847+
848+
if (lockit)
849+
raw_spin_lock_irqsave(&current->pi_lock, flags);
845850
call_srcu(srcu_ctlp, &rp->rtort_rcu, rcu_torture_cb);
851+
if (lockit)
852+
raw_spin_unlock_irqrestore(&current->pi_lock, flags);
846853
}
847854

848855
static void srcu_torture_synchronize(void)

0 commit comments

Comments
 (0)