Skip to contentSkip to conversation

tools/memory-model/Documentation: Fix SRCU section in explanation.txt

PATCH Applied Uladzislau Rezki (Sony) 3 participants 5 messages Apr 22, 2025

Subsystems (2)
lore
Share & tools
lore

Uladzislau Rezki (Sony)

author maintainer
#0 lore raw

PATCH 1/1 tools/memory-model/Documentation: Fix SRCU section in explanation.txt

The SRCU read-side critical sections describes the difference between srcu_down_read()/srcu_up_read() and srcu_read_lock()/srcu_read_unlock() in a way that a last pair must occur on the same CPU.

This is not true, the srcu_read_unlock() can happen on any CPU, but it must be performed by the same task that invoked srcu_read_lock().

---
 tools/memory-model/Documentation/explanation.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/memory-model/Documentation/explanation.txt +1 -1
index 6dc8b3642458..34aa3172071b 100644
@@ -1896,7 +1896,7 @@ following respects:
 
 3.	The srcu_down_read() and srcu_up_read() primitives work
 	exactly like srcu_read_lock() and srcu_read_unlock(), except
-	that matching calls don't have to execute on the same CPU.
+	that matching calls don't have to execute within the same context.
 	(The names are meant to be suggestive of operations on
 	semaphores.)  Since the matching is determined by the domain
 	pointer and index value, these primitives make it possible for
Signature · 1 line
2.39.5
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Uladzislau Rezki (Sony)

The SRCU read-side critical sections describes the difference between srcu_down_read()/srcu_up_read() and srcu_read_lock()/srcu_read_unlock() in a way that a last pair must occur on the same CPU.

This is not true, the srcu_read_unlock() can happen on any CPU, but it must be performed by the same task that invoked srcu_read_lock().

Good catch!

Quoted 20 lines
---
 tools/memory-model/Documentation/explanation.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/memory-model/Documentation/explanation.txt +1 -1
index 6dc8b3642458..34aa3172071b 100644
@@ -1896,7 +1896,7 @@ following respects:
 
 3.	The srcu_down_read() and srcu_up_read() primitives work
 	exactly like srcu_read_lock() and srcu_read_unlock(), except
-	that matching calls don't have to execute on the same CPU.
+	that matching calls don't have to execute within the same context.
 	(The names are meant to be suggestive of operations on
 	semaphores.)  Since the matching is determined by the domain
 	pointer and index value, these primitives make it possible for
Signature · 1 line
2.39.5
maintainer Applied
#2 lore raw
Quoted 5 lines · Paul E. McKenney
Quoted 4 lines · Uladzislau Rezki (Sony)

The SRCU read-side critical sections describes the difference between srcu_down_read()/srcu_up_read() and srcu_read_lock()/srcu_read_unlock() in a way that a last pair must occur on the same CPU.

Quoted 8 lines
Quoted 4 lines

This is not true, the srcu_read_unlock() can happen on any CPU, but it must be performed by the same task that invoked srcu_read_lock().

Good catch!

Applied, thanks.

maintainer
#3 lore raw
Quoted 11 lines · Joel Fernandes
Quoted 8 lines · Paul E. McKenney
Quoted 7 lines · Uladzislau Rezki (Sony)

The SRCU read-side critical sections describes the difference between srcu_down_read()/srcu_up_read() and srcu_read_lock()/srcu_read_unlock() in a way that a last pair must occur on the same CPU.

This is not true, the srcu_read_unlock() can happen on any CPU, but it must be performed by the same task that invoked srcu_read_lock().

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Good catch!

Applied, thanks.

Oops, though this is memory model and not RCU per-se. Paul do you want to take it or should I? ;)

- Joel

maintainer
#4 lore raw
Quoted 18 lines · Joel Fernandes
Quoted 15 lines · Joel Fernandes
Quoted 12 lines · Paul E. McKenney
Quoted 8 lines · Uladzislau Rezki (Sony)

The SRCU read-side critical sections describes the difference between srcu_down_read()/srcu_up_read() and srcu_read_lock()/srcu_read_unlock() in a way that a last pair must occur on the same CPU.

This is not true, the srcu_read_unlock() can happen on any CPU, but it must be performed by the same task that invoked srcu_read_lock().

Good catch!

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Applied, thanks.

Oops, though this is memory model and not RCU per-se. Paul do you want to take it or should I? ;)

Heh! I will take this one. One of those days, I guess!

Thanx, Pau