Received: by 10.192.165.148 with SMTP id m20csp1770002imm; Sat, 5 May 2018 22:21:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqaMZrM3feJZ4UPLFFlXBrbuVLyLKya29AkbCbybPSeCa+N8ZJzYQs4avTpju0BYAosytQR X-Received: by 2002:a63:ba5a:: with SMTP id l26-v6mr26961983pgu.5.1525584114061; Sat, 05 May 2018 22:21:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525584114; cv=none; d=google.com; s=arc-20160816; b=vFgbfflWicFCtk02qrZxJu44plo3T3r6qIVMkByBlPp2GANIgI1cLQubkZMVPeCZlD jUAVGSAh6A+9WYmjAUOCyd2KUW79bjKNW2XFjBUVgu4UtUKZzAjUHnJ9KxsvLpw5OOv/ FvfMaEjnItXOapRFSH43vK3hbV1Z21xD66e5aPg7pHT8bqXuarvoYIJwJcQ6i5pZmH0Y vAstt/WXgft0SGC9qc8NvPUyqaJ1/NDnZCBa7S5edwvOI1XU1aS5qT83h+qCMEvk8RKA iWwf1U7xklzZooOmrpOONK7PMY8YgMj7AibY/r7OTJjO/kq60yzyclxv01qKBP+tblyg MaRQ== 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=EZDx3WKZoQTJAYhEbPv69QQDg5Y7vWigHg6xTIzbuUI=; b=wXbAGUlL8nWSgokmjlyzVbPWSO/T6QBQRMZJRTu0DoEqoCkxtIw/il9VRQDmPag+sJ Q9F2LV0hdbF0eJIRWaq5TIqOeg73WnWGoIBJnap9hhFMUji3Pt1DrhZmCOlSFSxJ+gO6 vLBB+pxFwJ7RmVZakPWrxuk9YlLVFyhsn0W9xuUY6jzROg3wHg3OTo1ki5NcuJKztbLU Dk4AhY6NNwzk0k35zpcMnEylJwuOtoy9tMuRTolOAZuKwVF1dD1CdmTNdQsFOEbM0lQl U/FUmimiya7dWukAJZTMeDvgyeMUToXp8yevn7cE6WBWP4gXk55jptYlJ71Ho9OEYcUw tAqA== 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 y34-v6si18721378plb.248.2018.05.05.22.21.39; Sat, 05 May 2018 22:21:54 -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 S1751204AbeEFFTI (ORCPT + 99 others); Sun, 6 May 2018 01:19:08 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:36340 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750971AbeEFFTH (ORCPT ); Sun, 6 May 2018 01:19:07 -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 1fFC4c-0007nD-F6; Sun, 06 May 2018 13:19:02 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1fFC4Z-0006Ft-Dk; Sun, 06 May 2018 13:18:59 +0800 Date: Sun, 6 May 2018 13:18:59 +0800 From: Herbert Xu To: NeilBrown Cc: Thomas Graf , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/8] rhashtable: fix race in nested_table_alloc() Message-ID: <20180506051859.w7evarps5jdcplz6@gondor.apana.org.au> References: <152540595840.18473.11298241115621799037.stgit@noble> <152540605432.18473.11813271279255176724.stgit@noble> <20180505092907.2qa3scf6bzvubmtt@gondor.apana.org.au> <871sepepuj.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871sepepuj.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 07:48:20AM +1000, NeilBrown wrote: > > The spinlock protects 2 or more buckets. The nested table contains at > least 512 buckets, maybe more. > It is quite possible for two insertions into 2 different buckets to both > get their spinlock and both try to instantiate the same nested table. I think you missed the fact that when we use nested tables the spin lock table is limited to just a single page and hence corresponds to the first level in the nested table. Therefore it's always safe. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt