[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9905e2f8e28246929be7b77b78c07fb4@AcuMS.aculab.com>
Date: Thu, 3 Aug 2023 14:39:38 +0000
From: David Laight <David.Laight@...LAB.COM>
To: "'paulmck@...nel.org'" <paulmck@...nel.org>,
Alan Huang <mmpgouride@...il.com>
CC: Joel Fernandes <joel@...lfernandes.org>,
Eric Dumazet <edumazet@...gle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"rcu@...r.kernel.org" <rcu@...r.kernel.org>,
"roman.gushchin@...ux.dev" <roman.gushchin@...ux.dev>
Subject: RE: Question about the barrier() in hlist_nulls_for_each_entry_rcu()
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)
Powered by blists - more mailing lists