Received: by 10.192.165.148 with SMTP id m20csp991525imm; Sat, 5 May 2018 02:29:08 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqUhSa75yyFQKgaMcnokhc4+gD6h4kXoSriGLNEAf6OiRJ/4/Iw9B5DMGOXzJ6gM+DIiVFj X-Received: by 2002:a65:6592:: with SMTP id u18-v6mr16842406pgv.366.1525512548426; Sat, 05 May 2018 02:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525512548; cv=none; d=google.com; s=arc-20160816; b=jhyYa0uFE0XYY6sVNCDc07Q4EuayjagQIdkqpRe6WsbkSuoJipDTEIZsLEtxg7EKLR zy3FtzXiJwiRIe7I2jLaNrZJ8n5yBg3MGKCEKzvwpy2Ui1yXFi8VyqcXieeDgaZreUcv 2cjENRxupVZdP+mk3MdDasMZoIpDB2OQ2m0EIM+eWC0/zTEkBOGZycqfIpr7n9YJ/YNC mH+2/QYJFRC9UNB7VJvo/qVxzEENnkotMlhshNsIOAQ7otnGgLtXZ22JmzWERwiSR3RZ aL7owKqmo72ZdExgt2QDj+Qg7Q613QldWbJp7v1kUhsfMXhtmC0R8Le3k333EezpdAza 4VlA== 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=oZPp/E+JZ8smQf2l8h2DubeRfuexZYRq/CislGn720Q=; b=KP6q4wx5761/FZ4EyGKtJzPOuYH7bsRaQtUdxD2paHlLgouLP87NoNOoeOXFNtMrbE jDxJQhfoYFkxBEV3aLmR8q38i6v/cOflgaE735LVxBRLSlhe+0lGbKa9KRCCMdMBtzBE ncNcpcdzpBEtXaLN09eoyTI+WpUGGp+LkLFd6iqIG/K9n4P9NqaXT2Lg0kn6PekKLssW +L2g5vNO/PtZU8i/o6DkyhgZ9XZPhEq4mrR/Lgy+f9Ol0KoLDltHK9eDRchPgYTmZqLT 5hA8TOZvU8nSMlGUbCe1ZUv9+DNdM4iTSx01rw9faN0HN5GZukmNiJ5hLZaTKdvVibSU tULw== 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 s16-v6si2619011pgo.89.2018.05.05.02.28.54; Sat, 05 May 2018 02:29:08 -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 S1751739AbeEEJ1f (ORCPT + 99 others); Sat, 5 May 2018 05:27:35 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:35396 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751057AbeEEJ1d (ORCPT ); Sat, 5 May 2018 05:27:33 -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 1fEtTU-0001mT-Kc; Sat, 05 May 2018 17:27:28 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1fEtTR-0005yt-Ue; Sat, 05 May 2018 17:27:26 +0800 Date: Sat, 5 May 2018 17:27:25 +0800 From: Herbert Xu To: NeilBrown Cc: Thomas Graf , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/8] rhashtable: use cmpxchg() to protect ->future_tbl. Message-ID: <20180505092725.rlwn77d3yhknspdw@gondor.apana.org.au> References: <152540595840.18473.11298241115621799037.stgit@noble> <152540605430.18473.11758878046224478232.stgit@noble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152540605430.18473.11758878046224478232.stgit@noble> 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 Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: > Rather than borrowing one of the bucket locks to > protect ->future_tbl updates, use cmpxchg(). > This gives more freedom to change how bucket locking > is implemented. > > Signed-off-by: NeilBrown This looks nice. > - spin_unlock_bh(old_tbl->locks); > + rcu_assign_pointer(tmp, new_tbl); Do we need this barrier since cmpxchg is supposed to provide memory barrier semantics? > + if (cmpxchg(&old_tbl->future_tbl, NULL, tmp) != NULL) > + return -EEXIST; Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt