From: Peter Zijlstra <peterz@infradead.org>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Andrea Parri <parri.andrea@gmail.com>,
David Howells <dhowells@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Will Deacon <will@kernel.org>,
"Paul E. McKenney" <paulmck@linux.ibm.com>,
Mark Rutland <mark.rutland@arm.com>,
Linux List Kernel Mailing <linux-kernel@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
jose.marchesi@oracle.com
Subject: Re: Do we need to correct barriering in circular-buffers.rst?
Date: Mon, 30 Sep 2019 14:02:29 +0200 [thread overview]
Message-ID: <20190930120229.GD4581@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190930115440.GC4581@hirez.programming.kicks-ass.net>
On Mon, Sep 30, 2019 at 01:54:40PM +0200, Peter Zijlstra wrote:
> On Mon, Sep 30, 2019 at 11:33:52AM +0200, Peter Zijlstra wrote:
> > Like I said before, something like: "disallowing store hoists over control
> > flow depending on a volatile load" would be sufficient I think.
>
> We need to add 'control flow depending on an inline-asm' to that. We
> also very much use that.
An example of that would be something like:
bool spin_try_lock(struct spinlock *lock)
{
u32 zero = 0;
if (atomic_try_cmpxchg_relaxed(&lock->val, &zero, 1)) {
smp_acquire__after_ctrl_dep(); /* aka smp_rmb() */
return true;
}
return false;
}
(I think most our actual trylock functions use cmpxchg_acquire(), but the
above would be a valid implementation -- and it is the simplest
construct using smp_acquire__after_ctrl_dep() I could come up with in a
hurry)
prev parent reply other threads:[~2019-09-30 12:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-13 13:00 [RFC][PATCH] pipe: Convert ring to head/tail David Howells
2019-09-13 13:06 ` My just-shovel-data-through-for-X-amount-of-time test David Howells
2019-09-15 14:59 ` [RFC][PATCH] pipe: Convert ring to head/tail Will Deacon
2019-09-17 13:51 ` David Howells
2019-09-17 17:07 ` Will Deacon
2019-09-18 15:43 ` Do we need to correct barriering in circular-buffers.rst? David Howells
2019-09-18 16:48 ` Linus Torvalds
2019-09-19 13:59 ` David Howells
2019-09-19 15:59 ` Linus Torvalds
2019-09-23 14:49 ` Peter Zijlstra
2019-09-27 9:51 ` Andrea Parri
2019-09-27 12:49 ` Peter Zijlstra
2019-09-27 15:57 ` Peter Zijlstra
2019-09-27 20:43 ` Nick Desaulniers
2019-09-27 21:58 ` Nick Desaulniers
2019-09-30 9:33 ` Peter Zijlstra
2019-09-30 11:54 ` Peter Zijlstra
2019-09-30 12:02 ` Peter Zijlstra [this message]
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=20190930120229.GD4581@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=dhowells@redhat.com \
--cc=jose.marchesi@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=ndesaulniers@google.com \
--cc=parri.andrea@gmail.com \
--cc=paulmck@linux.ibm.com \
--cc=torvalds@linux-foundation.org \
--cc=will@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.