]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rcutorture: Test call_srcu() with preemption disabled and not
authorPaul E. McKenney <paulmck@kernel.org>
Sat, 14 Mar 2026 13:18:48 +0000 (06:18 -0700)
committerJoel Fernandes <joelagnelf@nvidia.com>
Mon, 30 Mar 2026 19:48:14 +0000 (15:48 -0400)
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>
kernel/rcu/rcutorture.c

index 3c272413666b2ea41c2a45f17ed5173b08679046..5f2848b828dc423edddc80bb77465bd33a908714 100644 (file)
@@ -842,7 +842,14 @@ static unsigned long srcu_torture_completed(void)
 
 static void srcu_torture_deferred_free(struct rcu_torture *rp)
 {
+       unsigned long flags;
+       bool lockit = jiffies & 0x1;
+
+       if (lockit)
+               raw_spin_lock_irqsave(&current->pi_lock, flags);
        call_srcu(srcu_ctlp, &rp->rtort_rcu, rcu_torture_cb);
+       if (lockit)
+               raw_spin_unlock_irqrestore(&current->pi_lock, flags);
 }
 
 static void srcu_torture_synchronize(void)