All of lore.kernel.org
 help / color / mirror / Atom feed
* rhashtable: Remove unnecessary wmb for future_tbl
@ 2015-12-08  9:09 Herbert Xu
  2015-12-09  2:52 ` Thomas Graf
  2015-12-09  3:47 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Herbert Xu @ 2015-12-08  9:09 UTC (permalink / raw)
  To: David S. Miller, Thomas Graf, Eric Dumazet, Josh Triplett,
	Paul E. McKenney, netdev

The patch 9497df88ab5567daa001829051c5f87161a81ff0 ("rhashtable:
Fix reader/rehash race") added a pair of barriers.  In fact the
wmb is superfluous because every subsequent write to the old or
new hash table uses rcu_assign_pointer, which itself carriers a
full barrier prior to the assignment.

Therefore we may remove the explicit wmb.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index 1c624db..d1f94b4 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -232,9 +232,6 @@ static int rhashtable_rehash_attach(struct rhashtable *ht,
 	 */
 	rcu_assign_pointer(old_tbl->future_tbl, new_tbl);
 
-	/* Ensure the new table is visible to readers. */
-	smp_wmb();
-
 	spin_unlock_bh(old_tbl->locks);
 
 	return 0;
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: rhashtable: Remove unnecessary wmb for future_tbl
  2015-12-08  9:09 rhashtable: Remove unnecessary wmb for future_tbl Herbert Xu
@ 2015-12-09  2:52 ` Thomas Graf
  2015-12-09  3:47 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Graf @ 2015-12-09  2:52 UTC (permalink / raw)
  To: Herbert Xu
  Cc: David S. Miller, Eric Dumazet, Josh Triplett, Paul E. McKenney, netdev

On 12/08/15 at 05:09pm, Herbert Xu wrote:
> The patch 9497df88ab5567daa001829051c5f87161a81ff0 ("rhashtable:
> Fix reader/rehash race") added a pair of barriers.  In fact the
> wmb is superfluous because every subsequent write to the old or
> new hash table uses rcu_assign_pointer, which itself carriers a
> full barrier prior to the assignment.
> 
> Therefore we may remove the explicit wmb.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

The RELEASE which is now in place afterwards act as a wmb as well,
we are well protected ;-)

Acked-by: Thomas Graf <tgraf@suug.ch>

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

* Re: rhashtable: Remove unnecessary wmb for future_tbl
  2015-12-08  9:09 rhashtable: Remove unnecessary wmb for future_tbl Herbert Xu
  2015-12-09  2:52 ` Thomas Graf
@ 2015-12-09  3:47 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-12-09  3:47 UTC (permalink / raw)
  To: herbert; +Cc: tgraf, eric.dumazet, josh, paulmck, netdev

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Tue, 8 Dec 2015 17:09:04 +0800

> The patch 9497df88ab5567daa001829051c5f87161a81ff0 ("rhashtable:
> Fix reader/rehash race") added a pair of barriers.  In fact the
> wmb is superfluous because every subsequent write to the old or
> new hash table uses rcu_assign_pointer, which itself carriers a
> full barrier prior to the assignment.
> 
> Therefore we may remove the explicit wmb.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Applied to net-next.

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

end of thread, other threads:[~2015-12-09  3:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-08  9:09 rhashtable: Remove unnecessary wmb for future_tbl Herbert Xu
2015-12-09  2:52 ` Thomas Graf
2015-12-09  3:47 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.