From mboxrd@z Thu Jan 1 00:00:00 1970 From: NeilBrown Subject: [PATCH 0/5] Rhashtable: convert to bit-spin locks. Date: Fri, 06 Jul 2018 17:22:30 +1000 Message-ID: <153086169828.24852.10332573315056854948.stgit@noble> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: Thomas Graf , Herbert Xu Return-path: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org bit-spinlocks are ideal for locking individual chains of a hashtable as they do not take extra memory, and they share a cachle line with the chain head which needs to be loaded (and often written) anyway. bit-spinlocks are not fair, but this is only a problem if contention is likely. Resizing hashtable are designed to avoid contention on individual chains - when chains have more than a very few object, the table is resized. This is a resend of patches which have been previously posted. The only comment raised before concerned the need for lockdep support and so the last patch was written and posted. The only changes is that another occurrence of 'locks_mul' needed to be removed. Thanks, NeilBrown --- NeilBrown (5): rhashtable: use cmpxchg() in nested_table_alloc() rhashtable: don't hold lock on first table throughout insertion. rhashtable: allow rht_bucket_var to return NULL. rhashtable: use bit_spin_locks to protect hash bucket. rhashtable: add lockdep tracking to bucket bit-spin-locks. include/linux/rhashtable-types.h | 2 include/linux/rhashtable.h | 216 +++++++++++++++++++++++++------------- ipc/util.c | 1 lib/rhashtable.c | 188 ++++++++++++++++----------------- net/bridge/br_fdb.c | 1 net/bridge/br_vlan.c | 1 net/bridge/br_vlan_tunnel.c | 1 net/ipv4/ipmr.c | 1 net/ipv6/ip6mr.c | 1 net/netfilter/nf_tables_api.c | 1 10 files changed, 233 insertions(+), 180 deletions(-) -- Signature