]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
srcu: Document that srcu_{read_lock,down_read}() can share srcu_struct
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 17 Jan 2025 17:14:18 +0000 (09:14 -0800)
committerBoqun Feng <boqun.feng@gmail.com>
Wed, 5 Feb 2025 15:12:06 +0000 (07:12 -0800)
This commit adds a sentence to the srcu_down_read() function's kernel-doc
header noting that it is permissible to use srcu_down_read() and
srcu_read_lock() on the same srcu_struct, even concurrently.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: <bpf@vger.kernel.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
include/linux/srcu.h

index a0df80baaccf3d05601194048868c8b381dc51ff..317eab82a5f0dd5b46ffdc12affc8b1743c2a89b 100644 (file)
@@ -359,7 +359,8 @@ srcu_read_lock_notrace(struct srcu_struct *ssp) __acquires(ssp)
  * srcu_down_read() nor srcu_up_read() may be invoked from an NMI handler.
  *
  * Calls to srcu_down_read() may be nested, similar to the manner in
- * which calls to down_read() may be nested.
+ * which calls to down_read() may be nested.  The same srcu_struct may be
+ * used concurrently by srcu_down_read() and srcu_read_lock().
  */
 static inline int srcu_down_read(struct srcu_struct *ssp) __acquires(ssp)
 {