From: Joel Fernandes <joel@joelfernandes.org>
To: paulmck@kernel.org, Alan Huang <mmpgouride@gmail.com>
Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, rostedt@goodmis.org
Subject: Re: [PATCH rcu 6/6] rcu: Use WRITE_ONCE() for assignments to ->next for rculist_nulls
Date: Tue, 18 Jul 2023 21:48:59 -0400 [thread overview]
Message-ID: <449d0d48-ac98-659b-4d03-e75c318605d4@joelfernandes.org> (raw)
In-Reply-To: <3f6b04b3-af22-49f0-8d3c-269640f9f762@paulmck-laptop>
On 7/18/23 14:32, Paul E. McKenney wrote:
> On Tue, Jul 18, 2023 at 10:48:07PM +0800, Alan Huang wrote:
>>
>>> 2023年7月18日 21:49,Joel Fernandes <joel@joelfernandes.org> 写道:
>>>
>>> On 7/17/23 14:03, Paul E. McKenney wrote:
>>>> From: Alan Huang <mmpgouride@gmail.com>
>>>> When the objects managed by rculist_nulls are allocated with
>>>> SLAB_TYPESAFE_BY_RCU, old readers may still hold references to an object
>>>> even though it is just now being added, which means the modification of
>>>> ->next is visible to readers. This patch therefore uses WRITE_ONCE()
>>>> for assignments to ->next.
>>>> Signed-off-by: Alan Huang <mmpgouride@gmail.com>
>>>> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
>>>
>>> Did we ever conclude that the READ_ONCE() counterparts were not needed? ;-)
>>
>> Read-side is already protected by rcu_dereference_raw() in hlist_nulls_for_each_entry_{rcu, safe}.
>
> It turns out that different traversal synchronization designs want
> different pointers using WRITE_ONCE().
Thank you Alan and Paul,
Btw, I don't see any users of hlist_nulls_unhashed_lockless(), maybe it
can be removed?
- Joel
next prev parent reply other threads:[~2023-07-19 1:49 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 18:03 [PATCH rcu 0/6] Miscellaneous fixes for v6.6 Paul E. McKenney
2023-07-17 18:03 ` [PATCH rcu 1/6] rcu: Update synchronize_rcu_mult() comment for call_rcu_hurry() Paul E. McKenney
2023-07-18 12:59 ` Joel Fernandes
2023-07-17 18:03 ` [PATCH rcu 2/6] rcu: Clarify rcu_is_watching() kernel-doc comment Paul E. McKenney
2023-07-18 12:52 ` Joel Fernandes
2023-07-18 18:12 ` Paul E. McKenney
2023-07-19 1:56 ` Joel Fernandes
2023-07-19 20:38 ` Paul E. McKenney
2023-07-17 18:03 ` [PATCH rcu 3/6] srcu,notifier: Remove #ifdefs in favor of SRCU Tiny srcu_usage Paul E. McKenney
2023-07-17 18:09 ` Linus Torvalds
2023-07-17 18:16 ` Paul E. McKenney
2023-07-17 18:03 ` [PATCH rcu 4/6] rcu: Mark __rcu_irq_enter_check_tick() ->rcu_urgent_qs load Paul E. McKenney
2023-07-18 12:58 ` Joel Fernandes
2023-07-17 18:03 ` [PATCH rcu 5/6] rcu: Make the rcu_nocb_poll boot parameter usable via boot config Paul E. McKenney
2023-07-18 13:46 ` Joel Fernandes
2023-07-17 18:03 ` [PATCH rcu 6/6] rcu: Use WRITE_ONCE() for assignments to ->next for rculist_nulls Paul E. McKenney
2023-07-18 13:49 ` Joel Fernandes
2023-07-18 14:48 ` Alan Huang
2023-07-18 18:32 ` Paul E. McKenney
2023-07-19 1:48 ` Joel Fernandes [this message]
2023-07-19 18:20 ` Paul E. McKenney
2023-07-19 19:17 ` Alan Huang
2023-07-19 20:02 ` Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=449d0d48-ac98-659b-4d03-e75c318605d4@joelfernandes.org \
--to=joel@joelfernandes.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mmpgouride@gmail.com \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®