[PATCH 11/13] srcutree: Remove srcu_barrier() sleep for atomic SRCU
From: Kunwu Chan
Date: Mon Sep 07 2026 - 04:08:08 EST
From: Kunwu Chan <kunwu.chan@xxxxxxxxx>
The atomic-SRCU path in srcu_barrier() sleeps for 100 milliseconds just
in case there are callbacks to wait for. But call_srcu() refuses
atomic SRCU with a WARN_ON_ONCE() before reaching the deferred-enqueue
path, so there can be no callbacks, deferred or otherwise.
Drop the sleep.
Signed-off-by: Kunwu Chan <kunwu.chan@xxxxxxxxx>
---
kernel/rcu/srcutree.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
index c19f59725706..a93bf803e2f7 100644
--- a/kernel/rcu/srcutree.c
+++ b/kernel/rcu/srcutree.c
@@ -1895,12 +1895,9 @@ void srcu_barrier(struct srcu_struct *ssp)
unsigned long s;
check_init_srcu_struct(ssp, false);
- if (WARN_ON_ONCE(ssp->srcu_reader_flavor == SRCU_READ_FLAVOR_ATOMIC)) {
- // There shouldn't be any callbacks for atomic SRCU,
- // but just in case.
- schedule_timeout_uninterruptible(HZ/10);
+ // Atomic SRCU has no callbacks, so there is nothing to wait on.
+ if (WARN_ON_ONCE(ssp->srcu_reader_flavor == SRCU_READ_FLAVOR_ATOMIC))
return;
- }
/*
* Register any deferred callbacks before snapshotting the sequence. The
--
2.43.0