From: David Laight <David.Laight@ACULAB.COM>
To: "'paulmck@kernel.org'" <paulmck@kernel.org>,
Alan Huang <mmpgouride@gmail.com>
Cc: Joel Fernandes <joel@joelfernandes.org>,
Eric Dumazet <edumazet@google.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"rcu@vger.kernel.org" <rcu@vger.kernel.org>,
"roman.gushchin@linux.dev" <roman.gushchin@linux.dev>
Subject: RE: Question about the barrier() in hlist_nulls_for_each_entry_rcu()
Date: Thu, 3 Aug 2023 14:39:38 +0000 [thread overview]
Message-ID: <9905e2f8e28246929be7b77b78c07fb4@AcuMS.aculab.com> (raw)
In-Reply-To: <bf86abde-6a90-4ea0-a298-abe5b367f4f9@paulmck-laptop>
From: Paul E. McKenney
> Sent: 03 August 2023 14:54
....
> > > If both are READ_ONCE(), you should not need the barrier(). Unless there
> > > is some other code not shown in your example that requires it, that is.
> >
> > And unless the compiler has a bug. :)
> >
> > So, the barrier() in hlist_nulls_for_each_entry_rcu() is a workaround for a compiler bug.
>
> Fair enough!!! ;-)
Except that it is likely that the compiler bug is avoided by the
implementation of READ_ONCE() rather than ACCESS_ONCE().
Also the code that looped forever (UDP receive socket lookup)
no longer has the retry - which is a different bug.
If a socket rehash hits the lookup then an erroneous ICMP
'port unreachable' is sent rather than doing a rescan.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2023-08-03 14:41 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 18:53 Question about the barrier() in hlist_nulls_for_each_entry_rcu() Alan Huang
2023-07-20 19:22 ` Eric Dumazet
2023-07-20 19:59 ` Alan Huang
2023-07-20 21:11 ` Eric Dumazet
2023-07-21 14:31 ` Alan Huang
2023-07-21 14:47 ` Eric Dumazet
2023-07-21 15:21 ` Alan Huang
2023-07-21 12:54 ` Joel Fernandes
2023-07-21 14:27 ` Alan Huang
2023-07-21 15:21 ` Joel Fernandes
2023-07-21 15:54 ` Alan Huang
2023-07-21 16:00 ` Joel Fernandes
2023-07-21 15:59 ` David Laight
2023-07-21 17:14 ` Joel Fernandes
2023-07-21 20:08 ` Alan Huang
2023-07-21 20:40 ` Alan Huang
2023-07-21 21:25 ` Alan Huang
2023-07-22 13:32 ` Alan Huang
2023-07-22 14:06 ` David Laight
2023-07-22 15:00 ` Alan Huang
2023-07-31 20:09 ` Paul E. McKenney
2023-08-03 13:40 ` Alan Huang
2023-08-03 13:53 ` Paul E. McKenney
2023-08-03 14:39 ` David Laight [this message]
2023-07-21 11:51 ` David Laight
2023-07-21 15:55 ` Alan Huang
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=9905e2f8e28246929be7b77b78c07fb4@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=edumazet@google.com \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmpgouride@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=roman.gushchin@linux.dev \
/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