summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2026-03-14 06:18:48 -0700
committerJoel Fernandes <joelagnelf@nvidia.com>2026-03-30 15:48:14 -0400
commit95c7d025cc8c3c6c41206e2a18332eb04878b7ef (patch)
tree057569e682cf961bf008b54a95efdf36f446fd45 /kernel
parentab875b3e179ff7ca2a982bc14f7fe810862c7594 (diff)
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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rcu/rcutorture.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 3c272413666b..5f2848b828dc 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -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)