From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756082AbcIAPai (ORCPT ); Thu, 1 Sep 2016 11:30:38 -0400 Received: from foss.arm.com ([217.140.101.70]:33506 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754206AbcIAPah (ORCPT ); Thu, 1 Sep 2016 11:30:37 -0400 Date: Thu, 1 Sep 2016 16:30:39 +0100 From: Will Deacon To: Manfred Spraul Cc: benh@kernel.crashing.org, paulmck@linux.vnet.ibm.com, Ingo Molnar , Boqun Feng , Peter Zijlstra , Andrew Morton , LKML , 1vier1@web.de, Davidlohr Bueso , Pablo Neira Ayuso , netfilter-devel@vger.kernel.org Subject: Re: [PATCH 8/7] net/netfilter/nf_conntrack_core: Remove another memory barrier Message-ID: <20160901153039.GN6721@arm.com> References: <1472743673-15585-1-git-send-email-manfred@colorfullife.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1472743673-15585-1-git-send-email-manfred@colorfullife.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 01, 2016 at 05:27:52PM +0200, Manfred Spraul wrote: > Since spin_unlock_wait() is defined as equivalent to spin_lock(); > spin_unlock(), the memory barrier before spin_unlock_wait() is > also not required. > > Not for stable! > > Signed-off-by: Manfred Spraul > Cc: Pablo Neira Ayuso > Cc: netfilter-devel@vger.kernel.org > --- > net/netfilter/nf_conntrack_core.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c > index 7a3b5e6..0591a25 100644 > --- a/net/netfilter/nf_conntrack_core.c > +++ b/net/netfilter/nf_conntrack_core.c > @@ -139,13 +139,7 @@ static void nf_conntrack_all_lock(void) > > spin_lock(&nf_conntrack_locks_all_lock); > > - /* > - * Order the store of 'nf_conntrack_locks_all' against > - * the spin_unlock_wait() loads below, such that if > - * nf_conntrack_lock() observes 'nf_conntrack_locks_all' > - * we must observe nf_conntrack_locks[] held: > - */ > - smp_store_mb(nf_conntrack_locks_all, true); > + nf_conntrack_locks_all = true; Don't you at least need WRITE_ONCE if you're going to do this? Will