Skip to content

rhashtable: Per bucket locks & deferred table resizing

Thomas Graf lkml netdev netfilter-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 3 repliesIn review
  2. v19 patches 36 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9rhashtable: Do hashing inside of rhashtable_lookup_compare()include/linux/rhashtable.h lib/rhashtable.c net/netfilter/nft_hash.c +1 more+61 -862 replies
2/9rhashtable: Use rht_obj() instead of manual offset calculationlib/rhashtable.c+2 -20 replies
3/9rhashtable: Convert bucket iterators to take table and indexinclude/linux/rhashtable.h lib/rhashtable.c net/netfilter/nft_hash.c +2 more+152 -790 replies
4/9rhashtable: Factor out bucket_tail() functionlib/rhashtable.c+14 -90 replies
5/9nft_hash: Remove rhashtable_remove_pprev()include/linux/rhashtable.h lib/rhashtable.c net/netfilter/nft_hash.c+10 -370 replies
6/9spinlock: Add spin_lock_bh_nested()include/linux/spinlock.h include/linux/spinlock_api_smp.h include/linux/spinlock_api_up.h +1 more+19 -00 replies
7/9rhashtable: Per bucket locks & deferred expansion/shrinkinginclude/linux/rhashtable.h lib/rhashtable.c net/netfilter/nft_hash.c +1 more+384 -1530 replies
8/9rhashtable: Supports for nulls markerinclude/linux/list_nulls.h include/linux/rhashtable.h lib/rhashtable.c+79 -180 replies
9/9netlink: Lockless lookup with RCU grace period in socket releasenet/netlink/af_netlink.c net/netlink/af_netlink.h+17 -163 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH 0/9 net-next v2] rhashtable: Per bucket locks & deferred table resizing

Prepares for and introduces per bucket spinlocks and deferred table resizing. This allows for parallel table mutations in different hash buckets from atomic context. The resizing occurs in the background in a separate worker thread while lookups, inserts, and removals can continue.

Also modified the chain linked list to be terminated with a special nulls marker to allow entries to move between multiple lists.

Last but not least, reintroduces lockless netlink_lookup() with deferred Netlink socket destruction to avoid the side effect of increased netlink_release() runtime.

Thomas Graf (9):
rhashtable: Do hashing inside of rhashtable_lookup_compare()
rhashtable: Use rht_obj() instead of manual offset calculation
rhashtable: Convert bucket iterators to take table and index
rhashtable: Factor out bucket_tail() function
nft_hash: Remove rhashtable_remove_pprev()
spinlock: Add spin_lock_bh_nested()
rhashtable: Per bucket locks & deferred expansion/shrinking
rhashtable: Supports for nulls marker
netlink: Lockless lookup with RCU grace period in socket release

 include/linux/list_nulls.h       |   3 +-
 include/linux/rhashtable.h       | 258 ++++++++++++-----
 include/linux/spinlock.h         |   8 +
 include/linux/spinlock_api_smp.h |   2 +
 include/linux/spinlock_api_up.h  |   1 +
 kernel/locking/spinlock.c        |   8 +
 lib/rhashtable.c                 | 607 ++++++++++++++++++++++++++-------------
 net/netfilter/nft_hash.c         |  92 +++---
 net/netlink/af_netlink.c         |  64 ++---
 net/netlink/af_netlink.h         |   1 +
 net/netlink/diag.c               |   4 +-
 11 files changed, 693 insertions(+), 355 deletions(-)
Signature · 1 line
1.9.3