]> Gentwo Git Trees - linux/.git/commitdiff
doc: Update for SRCU-fast definitions and initialization
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 5 Nov 2025 20:32:09 +0000 (12:32 -0800)
committerFrederic Weisbecker <frederic@kernel.org>
Wed, 5 Nov 2025 22:58:30 +0000 (23:58 +0100)
This commit documents the DEFINE_SRCU_FAST(), DEFINE_STATIC_SRCU_FAST(),
and init_srcu_struct_fast() API members.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: <bpf@vger.kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Documentation/RCU/Design/Requirements/Requirements.rst
Documentation/RCU/checklist.rst
Documentation/RCU/whatisRCU.rst

index f24b3c0b9b0dc6507693f49434b05fe9b453b513..ba417a08b93dfb2304b9e7cf37d1d5df371caba4 100644 (file)
@@ -2637,15 +2637,16 @@ synchronize_srcu() for some other domain ``ss1``, and if an
 that was held across as ``ss``-domain synchronize_srcu(), deadlock
 would again be possible. Such a deadlock cycle could extend across an
 arbitrarily large number of different SRCU domains. Again, with great
-power comes great responsibility.
+power comes great responsibility, though lockdep is now able to detect
+this sort of deadlock.
 
-Unlike the other RCU flavors, SRCU read-side critical sections can run
-on idle and even offline CPUs. This ability requires that
-srcu_read_lock() and srcu_read_unlock() contain memory barriers,
-which means that SRCU readers will run a bit slower than would RCU
-readers. It also motivates the smp_mb__after_srcu_read_unlock() API,
-which, in combination with srcu_read_unlock(), guarantees a full
-memory barrier.
+Unlike the other RCU flavors, SRCU read-side critical sections can run on
+idle and even offline CPUs, with the exception of srcu_read_lock_fast()
+and friends.  This ability requires that srcu_read_lock() and
+srcu_read_unlock() contain memory barriers, which means that SRCU
+readers will run a bit slower than would RCU readers. It also motivates
+the smp_mb__after_srcu_read_unlock() API, which, in combination with
+srcu_read_unlock(), guarantees a full memory barrier.
 
 Also unlike other RCU flavors, synchronize_srcu() may **not** be
 invoked from CPU-hotplug notifiers, due to the fact that SRCU grace
@@ -2681,15 +2682,15 @@ run some tests first. SRCU just might need a few adjustment to deal with
 that sort of load. Of course, your mileage may vary based on the speed
 of your CPUs and the size of your memory.
 
-The `SRCU
-API <https://lwn.net/Articles/609973/#RCU%20Per-Flavor%20API%20Table>`__
+The `SRCU API
+<https://lwn.net/Articles/609973/#RCU%20Per-Flavor%20API%20Table>`__
 includes srcu_read_lock(), srcu_read_unlock(),
-srcu_dereference(), srcu_dereference_check(),
-synchronize_srcu(), synchronize_srcu_expedited(),
-call_srcu(), srcu_barrier(), and srcu_read_lock_held(). It
-also includes DEFINE_SRCU(), DEFINE_STATIC_SRCU(), and
-init_srcu_struct() APIs for defining and initializing
-``srcu_struct`` structures.
+srcu_dereference(), srcu_dereference_check(), synchronize_srcu(),
+synchronize_srcu_expedited(), call_srcu(), srcu_barrier(),
+and srcu_read_lock_held(). It also includes DEFINE_SRCU(),
+DEFINE_STATIC_SRCU(), DEFINE_SRCU_FAST(), DEFINE_STATIC_SRCU_FAST(),
+init_srcu_struct(), and init_srcu_struct_fast() APIs for defining and
+initializing ``srcu_struct`` structures.
 
 More recently, the SRCU API has added polling interfaces:
 
index c9bfb2b218e525bb8a06373a900f930c59b09a2f..4b30f701225fdb779b1865eca96082f68bc92ab8 100644 (file)
@@ -417,11 +417,13 @@ over a rather long period of time, but improvements are always welcome!
        you should be using RCU rather than SRCU, because RCU is almost
        always faster and easier to use than is SRCU.
 
-       Also unlike other forms of RCU, explicit initialization and
-       cleanup is required either at build time via DEFINE_SRCU()
-       or DEFINE_STATIC_SRCU() or at runtime via init_srcu_struct()
-       and cleanup_srcu_struct().  These last two are passed a
-       "struct srcu_struct" that defines the scope of a given
+       Also unlike other forms of RCU, explicit initialization
+       and cleanup is required either at build time via
+       DEFINE_SRCU(), DEFINE_STATIC_SRCU(), DEFINE_SRCU_FAST(),
+       or DEFINE_STATIC_SRCU_FAST() or at runtime via either
+       init_srcu_struct() or init_srcu_struct_fast() and
+       cleanup_srcu_struct().  These last three are passed a
+       `struct srcu_struct` that defines the scope of a given
        SRCU domain.  Once initialized, the srcu_struct is passed
        to srcu_read_lock(), srcu_read_unlock() synchronize_srcu(),
        synchronize_srcu_expedited(), and call_srcu().  A given
index cf0b0ac9f4636ab9d9bfafc4365598abee3ba8e6..a1582bd653d115bad3a1002e6d2d25b779367b84 100644 (file)
@@ -1227,7 +1227,10 @@ SRCU: Initialization/cleanup/ordering::
 
        DEFINE_SRCU
        DEFINE_STATIC_SRCU
+       DEFINE_SRCU_FAST        // for srcu_read_lock_fast() and friends
+       DEFINE_STATIC_SRCU_FAST // for srcu_read_lock_fast() and friends
        init_srcu_struct
+       init_srcu_struct_fast
        cleanup_srcu_struct
        smp_mb__after_srcu_read_unlock