Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp742540yba; Mon, 1 Apr 2019 16:09:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/cSJ8mSopmEKkeELXIjsYZtQg9xB6tMY9dI9VBC5gdSGoFOyrNZ0LfJUrvWYsoyBMbQ8y X-Received: by 2002:a62:571b:: with SMTP id l27mr37658687pfb.195.1554160144711; Mon, 01 Apr 2019 16:09:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554160144; cv=none; d=google.com; s=arc-20160816; b=zpfTSnx9afZrBuCWB8N7tbqTLqmEwh1l0O979B5/89hYYggvOuqXZXW7ZlKoDXRfJV hNX/y+BRMflSR0VsXDkXYvedtoraxG3774PTV79gQ48sPKmTVJ/fh3Jevm/SoD8gvvKw viq1T067drOmMqOz0FWfYC6midkoj5Roq5zHvq6ws7k+VtwgACXsTR2Sy1OLtuEyTpTB vN2VmnmghopT1+DYI03KqVJ6GRO/NNoyBviBw5XN2F+1cPw/WJu+BKajJDmUErKHs6w6 e3yHJbEpOJFx0iZwP1Bqo5gLr701J2nv3pRf+ILjlVksjxuNvsRBJU+ki0tjVvH9a22o Hgqg== 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; bh=jpVQlToYVUgRYYE8CAkxTr2p0Be9rCgbq2EzH0TX1CM=; b=Cbt3ffdPn+u+MpVlg+0eYv3ax9YNHmuMPBtL/uXhI5fR7kSmYMPnlctw6kNl6oYlxB klZunXm1ljpz5s8B5BlfVQi/5kYBm+/bvl2oDfpMHyGXdrbkk/03q+p8G6RDqRD6+jWQ 9peb1a/jZKmLM57dHnEbsqA5C3aSp8UmopI9+vwGjk99Jt7h4urXxudQaaBVjVYhFeCO anL5Xqy/0aidlU3Mvx469jz0ws5WTzhHR9s8F1yYVn1EFfFtPgefmDLvWKvU0sEXBCGm QvTnxWDl8QiVeUkk+PA/TaqZjCol++NUKpkKRJ1B5UhDDDpNr1hGJsCeZlMB4Mpv4xxq DK0Q== 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 ci5si2572908plb.145.2019.04.01.16.08.49; Mon, 01 Apr 2019 16:09:04 -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 S1726913AbfDAXIM (ORCPT + 99 others); Mon, 1 Apr 2019 19:08:12 -0400 Received: from mx2.suse.de ([195.135.220.15]:54276 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725891AbfDAXIM (ORCPT ); Mon, 1 Apr 2019 19:08:12 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 3676AAFF9; Mon, 1 Apr 2019 23:08:11 +0000 (UTC) From: NeilBrown To: Thomas Graf , Herbert Xu Date: Tue, 02 Apr 2019 10:07:45 +1100 Subject: [PATCH 0/4 v2] Convert rhashtable to use bitlocks Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <155416000985.9540.14182958463813560577.stgit@noble.brown> 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 This series converts rhashtable to use a per-bucket bitlock rather than a separate array of spinlocks. This: reduces memory usage results in slightly fewer memory accesses slightly improves parallelism makes a configuration option unnecessary The main change from previous version is to use a distinct type for the pointer in the bucket which has a bit-lock in it. This helped find two places where rht_ptr() was missed, one in rhashtable_free_and_destroy() in print_ht in the test code. Thanks, NeilBrown --- NeilBrown (4): rhashtable: use cmpxchg() in nested_table_alloc() 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 | 271 ++++++++++++++++++++++++++------------ ipc/util.c | 1 lib/rhashtable.c | 161 ++++++++++++----------- lib/test_rhashtable.c | 2 net/bridge/br_fdb.c | 1 net/bridge/br_multicast.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 12 files changed, 271 insertions(+), 173 deletions(-) -- Signature