Skip to content

Commit

Permalink
rhashtable: Remove unnecessary wmb for future_tbl
Browse files Browse the repository at this point in the history
The patch 9497df8 ("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>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Dec 9, 2015
1 parent bc22ff5 commit 46c749e
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions lib/rhashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,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;
Expand Down

0 comments on commit 46c749e

Please sign in to comment.