]> git.baikalelectronics.ru Git - kernel.git/commit
nft_hash: Remove rhashtable_remove_pprev()
authorThomas Graf <tgraf@suug.ch>
Fri, 2 Jan 2015 22:00:18 +0000 (23:00 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 3 Jan 2015 19:32:57 +0000 (14:32 -0500)
commit1c37fc938a2e650761b97e0042becb0792f070f9
treeefddc040f4d1042b486100cb20c3c3036b292420
parent4546847c93d429552dc6aac9607d7e969428b593
nft_hash: Remove rhashtable_remove_pprev()

The removal function of nft_hash currently stores a reference to the
previous element during lookup which is used to optimize removal later
on. This was possible because a lock is held throughout calling
rhashtable_lookup() and rhashtable_remove().

With the introdution of deferred table resizing in parallel to lookups
and insertions, the nftables lock will no longer synchronize all
table mutations and the stored pprev may become invalid.

Removing this optimization makes removal slightly more expensive on
average but allows taking the resize cost out of the insert and
remove path.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Cc: netfilter-devel@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/rhashtable.h
lib/rhashtable.c
net/netfilter/nft_hash.c