Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1476421imm; Fri, 6 Jul 2018 00:24:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcfT8r5FfAKE1Xd9ZAk3YIIHgnnxIr7npDmaTTb+ckmKSoZGpVO7jdRHxK3iFeUj6ocOiBp X-Received: by 2002:a65:6102:: with SMTP id z2-v6mr8582755pgu.46.1530861874457; Fri, 06 Jul 2018 00:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530861874; cv=none; d=google.com; s=arc-20160816; b=fU7ndKMKscbAc6TzkKk2mgCoboTLT/IxdKpuszSPnBu5Xr1j6XbUuHx/NEZQNGQDUy SdI45m0k1Mq2WjArVfTy/lXAcERAlcxI/jsCywQzyBcL4Jo+yt6pm/rN0wzo0LdfeauK pA3eOa0w3uZHwl8Z76i+JQhu6/tfklAB3km0KHbmTxf/N82hA9TvXGFjJoaKykG128jH adoEv8ABC3k1OUCvz/o6D4a2qBvCCLOjHXr93H7QrRUY4u4/uHVHgv2OhAAiU4h5Ippd e1lWOFvBdrB7dCuvHljXEU4fqNXqEU+ghZxrE4g0MPH6BaCgkpiUeCRxeGgHvy9lnEbO KK9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:cc:subject:date:to:from :arc-authentication-results; bh=HQ3/WDcl5OLLoclpfMKIDIAFcbexS7a8YaSAAZ9qyqE=; b=ffqQ2SiHgDp9aCUZrnDcD5/udAd3tw2x1mKDlhU+fsIPpq1zLj3ybMsuP8Hao18UNY jlMdbtuIssdgLbF9iHJgylxr5Eg0CYd6OKQcg3WrQX+AG2VzEHBljxO4StbIP5dYbo4H rlasEQHPzS5X2mG+J4tiiugayBvQLsAHu+SRLHc9QhVqqRPr+JIKc1D5W0VediB/kxgY jZ/u6OXGKmf4tbbrj8A86bK2DjcWkptgGrVagqI/8XFrJk7eDsv4WlFBQJ60d01wTyfm UdVoyiVzKvPmUF66nO72SXRlVO8BP/UbkRf/8ecNpwFVWx+7qUJCJrPOAg58F02TRWx8 UkJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l21-v6si7260143pgo.272.2018.07.06.00.24.19; Fri, 06 Jul 2018 00:24:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754102AbeGFHXI (ORCPT + 99 others); Fri, 6 Jul 2018 03:23:08 -0400 Received: from mx2.suse.de ([195.135.220.15]:48834 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753476AbeGFHXF (ORCPT ); Fri, 6 Jul 2018 03:23:05 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 99439AFAC; Fri, 6 Jul 2018 07:23:04 +0000 (UTC) From: NeilBrown To: Thomas Graf , Herbert Xu Date: Fri, 06 Jul 2018 17:22:30 +1000 Subject: [PATCH 0/5] Rhashtable: convert to bit-spin locks. Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <153086169828.24852.10332573315056854948.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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