From: Boqun Feng <boqun.feng@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will.deacon@arm.com>,
Manfred Spraul <manfred@colorfullife.com>,
benh@kernel.crashing.org, paulmck@linux.vnet.ibm.com,
Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
1vier1@web.de, Davidlohr Bueso <dave@stgolabs.net>,
Pablo Neira Ayuso <pablo@netfilter.org>,
netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 8/7] net/netfilter/nf_conntrack_core: Remove another memory barrier
Date: Fri, 2 Sep 2016 14:17:50 +0800 [thread overview]
Message-ID: <20160902061750.GE28226@tardis.cn.ibm.com> (raw)
In-Reply-To: <20160901164126.GZ10153@twins.programming.kicks-ass.net>
[-- Attachment #1: Type: text/plain, Size: 1214 bytes --]
Hi Manfred,
On Thu, Sep 01, 2016 at 06:41:26PM +0200, Peter Zijlstra wrote:
> On Thu, Sep 01, 2016 at 04:30:39PM +0100, Will Deacon wrote:
> > 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.
>
As Peter said below, ACQUIRE+RELEASE is not a barrier.
What we rely here is that spin_unlock_wait() could pair with another
LOCK or UNLOCK(as spin_unlock_wait() acts as spin_lock();
spin_unlock()). And once paired, we could have the necessary order
guarantee between the code preceding or following unlock_wait() and the
code in the lock critical sections.
Regards,
Boqun
> Note that ACQUIRE+RELEASE isn't a barrier.
>
> Both are semi-permeable and things can cross in the middle, like:
>
>
> x = 1;
> LOCK
> UNLOCK
> r = y;
>
> can (validly) get re-ordered like:
>
> LOCK
> r = y;
> x = 1;
> UNLOCK
>
> So if you want things ordered, as I think you do, I think the smp_mb()
> is still needed.
>
> RELEASE + ACQUIRE otoh, that is a load-store barrier (but not
> transitive).
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2016-09-02 6:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-01 15:27 Manfred Spraul
2016-09-01 15:27 ` [PATCH 9/7] ipc/sem.c: " Manfred Spraul
2016-09-01 15:30 ` [PATCH 8/7] net/netfilter/nf_conntrack_core: " Will Deacon
2016-09-01 16:41 ` Peter Zijlstra
2016-09-02 6:17 ` Boqun Feng [this message]
2016-09-02 6:35 ` Manfred Spraul
2016-09-02 19:22 ` Peter Zijlstra
2016-09-03 5:33 ` Manfred Spraul
2016-09-05 18:57 ` Manfred Spraul
2016-09-06 17:56 ` Will Deacon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160902061750.GE28226@tardis.cn.ibm.com \
--to=boqun.feng@gmail.com \
--cc=1vier1@web.de \
--cc=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=dave@stgolabs.net \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=mingo@elte.hu \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®