linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] docs/RCU: Add the missing rcu_read_unlock()
@ 2023-06-10  4:06 Alan Huang
  2023-06-12 21:26 ` Paul E. McKenney
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Huang @ 2023-06-10  4:06 UTC (permalink / raw)
  To: paulmck; +Cc: corbet, rcu, linux-doc, Alan Huang

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

Signed-off-by: Alan Huang <mmpgouride@gmail.com>
---
 Documentation/RCU/rculist_nulls.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/RCU/rculist_nulls.rst b/Documentation/RCU/rculist_nulls.rst
index 9a734bf54..4370ac864 100644
--- a/Documentation/RCU/rculist_nulls.rst
+++ b/Documentation/RCU/rculist_nulls.rst
@@ -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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] docs/RCU: Add the missing rcu_read_unlock()
  2023-06-10  4:06 [PATCH] docs/RCU: Add the missing rcu_read_unlock() Alan Huang
@ 2023-06-12 21:26 ` Paul E. McKenney
  2023-06-13  0:59   ` Alan Huang
  0 siblings, 1 reply; 3+ messages in thread
From: Paul E. McKenney @ 2023-06-12 21:26 UTC (permalink / raw)
  To: Alan Huang; +Cc: corbet, rcu, linux-doc

On Sat, Jun 10, 2023 at 04:06:08AM +0000, Alan Huang wrote:
> We should exit the RCU read-side critical section before re-entering.
> 
> Signed-off-by: Alan Huang <mmpgouride@gmail.com>
> ---
>  Documentation/RCU/rculist_nulls.rst | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/RCU/rculist_nulls.rst b/Documentation/RCU/rculist_nulls.rst
> index 9a734bf54..4370ac864 100644
> --- a/Documentation/RCU/rculist_nulls.rst
> +++ b/Documentation/RCU/rculist_nulls.rst
> @@ -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

>        goto begin;
>      /*
>      * Because a writer could delete object, and a writer could
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] docs/RCU: Add the missing rcu_read_unlock()
  2023-06-12 21:26 ` Paul E. McKenney
@ 2023-06-13  0:59   ` Alan Huang
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Huang @ 2023-06-13  0:59 UTC (permalink / raw)
  To: paulmck; +Cc: corbet, rcu, linux-doc


> 2023年6月13日 05:26,Paul E. McKenney <paulmck@kernel.org> 写道:
> 
> On Sat, Jun 10, 2023 at 04:06:08AM +0000, Alan Huang wrote:
>> We should exit the RCU read-side critical section before re-entering.
>> 
>> Signed-off-by: Alan Huang <mmpgouride@gmail.com>
>> ---
>> Documentation/RCU/rculist_nulls.rst | 1 +
>> 1 file changed, 1 insertion(+)
>> 
>> diff --git a/Documentation/RCU/rculist_nulls.rst b/Documentation/RCU/rculist_nulls.rst
>> index 9a734bf54..4370ac864 100644
>> --- a/Documentation/RCU/rculist_nulls.rst
>> +++ b/Documentation/RCU/rculist_nulls.rst
>> @@ -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

> 
> Thanx, Paul
> 
>>       goto begin;
>>     /*
>>     * Because a writer could delete object, and a writer could
>> -- 
>> 2.34.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-13  1:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-10  4:06 [PATCH] docs/RCU: Add the missing rcu_read_unlock() Alan Huang
2023-06-12 21:26 ` Paul E. McKenney
2023-06-13  0:59   ` Alan Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).