Skip to contentSkip to conversation

docs/RCU: Add the missing rcu_read_unlock()

PATCH Superseded Alan Huang 2 participants 3 messages Jun 10, 2023 – Jun 13, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Alan Huang

author
#0 lore raw

PATCH 1/1 docs/RCU: Add the missing rcu_read_unlock()

We should exit the RCU read-side critical section before re-entering.

---
 Documentation/RCU/rculist_nulls.rst | 1 +
 1 file changed, 1 insertion(+)
Documentation/RCU/rculist_nulls.rst +1 -0
index 9a734bf54..4370ac864 100644
@@ -30,6 +30,7 @@ algorithms:
   obj = lockless_lookup(key);
   if (obj) {
     if (!try_get_ref(obj)) // might fail for free objects
+      rcu_read_unlock();
       goto begin;
     /*
     * Because a writer could delete object, and a writer could
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 12 lines · Alan Huang

We should exit the RCU read-side critical section before re-entering.

---
 Documentation/RCU/rculist_nulls.rst | 1 +
 1 file changed, 1 insertion(+)
Documentation/RCU/rculist_nulls.rst +0 -0
index 9a734bf54..4370ac864 100644

Documentation/RCU/rculist_nulls.rst algorithms: · line 33

Quoted 4 lines
Documentation/RCU/rculist_nulls.rst +1 -0
@@ -30,6 +30,7 @@ algorithms:
   obj = lockless_lookup(key);
   if (obj) {
     if (!try_get_ref(obj)) // might fail for free objects
+      rcu_read_unlock();

Good eyes! But don't we also need a pair of braces?

Thanx, Paul

Quoted 6 lines
Documentation/RCU/rculist_nulls.rst +0 -0
       goto begin;
     /*
     * Because a writer could delete object, and a writer could
Signature · 1 line
2.34.1
author
#2 lore raw
Quoted 11 lines

2023年6月13日 05:26,Paul E. McKenney <[email protected]> 写道:

Quoted 7 lines · Alan Huang

We should exit the RCU read-side critical section before re-entering.

---
Documentation/RCU/rculist_nulls.rst | 1 +

1 file changed, 1 insertion(+)
Quoted 11 lines

Documentation/RCU/rculist_nulls.rst algorithms: · line 33

Quoted 9 lines
Documentation/RCU/rculist_nulls.rst +1 -0
index 9a734bf54..4370ac864 100644
@@ -30,6 +30,7 @@ algorithms:
  obj = lockless_lookup(key);
  if (obj) {
    if (!try_get_ref(obj)) // might fail for free objects
+      rcu_read_unlock();

Good eyes! But don't we also need a pair of braces?

Yeah! We need that. I have sent the v2.

Thanks,
Alan

Quoted 8 lines

Thanx, Paul

Quoted 5 lines
Documentation/RCU/rculist_nulls.rst +0 -0
      goto begin;
    /*
    * Because a writer could delete object, and a writer could
Signature · 1 line
2.34.1