Received: by 10.192.165.148 with SMTP id m20csp1769764imm; Sat, 5 May 2018 22:21:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrpdrYk4tTofeIH59J2cXxhmpJvqZV9RJTsy9Bdsp/lYByfS+LnSsjKwJeGtz4aTMihup+O X-Received: by 2002:a17:902:8ec4:: with SMTP id x4-v6mr33210845plo.370.1525584084245; Sat, 05 May 2018 22:21:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525584084; cv=none; d=google.com; s=arc-20160816; b=kvQb86NLUCocgWtylXgOuI24RVktUBSsob53OHw/+COyUgFkRDch5O4JC++ftBIyeG KWVKF036Ma94esQStrKEUzY37VOyK6oY0+JpYoM0+p4udtm6/xObQsAn55CWCC4Iy8op W0A3zDVt0lI8Z5jCCSXhYaB/AEoofMAVODmE21GCKmf9Ym46p4qhNsT0xE/re/G/1xuE TQ9K9fpsIuebJd+RmnnGh9YcGlS2+N8zeFdT3eAwuIqIDYQJMRQxV/NvcU7AAs/82Bda 1r1yYaFGl4z4JtqksMn5SWZ2tdJfQeSLC14gFfx/U2NYa1jBOVJjmUqEOqB7/VjthOQ7 cV5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=XjdYOTd3z0HXOzYrcwR7v/dv/xAj+jMLS86pDDsOGJk=; b=a16sLxHkVV07nZJnuod8s1IMg9SGIcE6IF4qoGP3yiHlzRJ29Hm55TGw4d/FL+Y0WK MxvmfETgNVfnD5Izwcaabdgpp4OUxeCwaIIkJBrtNzajC/Ve0pXDzGWA14yDg1J0gSLU v6REd9hVSvKedS46dqvLwWBmCtjC6AUta0EagXnmFD5okBRn0J4ES7at6r1AM9zpKwqx mbk0H+l2nFcua16XyHqZNKA00kKvyRn5KCpNR6Ct8+ffjzWJNSdEnAAlb5v2EIJ6jfwv /olOOcDB+niL8XMj5uz4wkD9bdRgnoJMcCJ+G/C0SEBTqHHKA3moFX6Wfz02OsQr3HyQ Q9tw== 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 r13-v6si6398365pgq.675.2018.05.05.22.20.57; Sat, 05 May 2018 22:21:24 -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 S1751398AbeEFFUF (ORCPT + 99 others); Sun, 6 May 2018 01:20:05 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:36350 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750981AbeEFFUD (ORCPT ); Sun, 6 May 2018 01:20:03 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1fFC5Y-0007oA-FC; Sun, 06 May 2018 13:20:00 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1fFC5Y-0006GR-Aw; Sun, 06 May 2018 13:20:00 +0800 Date: Sun, 6 May 2018 13:20:00 +0800 From: Herbert Xu To: NeilBrown Cc: Thomas Graf , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 8/8] rhashtable: don't hold lock on first table throughout insertion. Message-ID: <20180506052000.7yehd5lke3smccoj@gondor.apana.org.au> References: <152540595840.18473.11298241115621799037.stgit@noble> <152540605444.18473.9591316658457316578.stgit@noble> <20180505094117.pl7b6bbk6mtyri6d@gondor.apana.org.au> <87sh75dapa.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87sh75dapa.fsf@notabene.neil.brown.name> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 06, 2018 at 08:00:49AM +1000, NeilBrown wrote: > > The insert function must (and does) take the lock on the bucket before > testing if there is a "next" table. > If one inserter finds that it has locked the "last" table (because there > is no next) and successfully inserts, then the other inserter cannot > have locked that table yet, else it would have inserted. When it does, > it will find what the first inserter inserted. If you release the lock to the first table then it may be deleted by the resize thread. Hence the other inserter may not have even started from the same place. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt