From: Will Deacon <will.deacon@arm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Ingo Molnar <mingo@kernel.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Oleg Nesterov <oleg@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Q: schedule() and implied barriers on arm64
Date: Tue, 27 Oct 2015 16:19:48 +0000 [thread overview]
Message-ID: <20151027161948.GE20208@arm.com> (raw)
In-Reply-To: <20151019162423.GP3816@twins.programming.kicks-ass.net>
On Mon, Oct 19, 2015 at 06:24:23PM +0200, Peter Zijlstra wrote:
> On Mon, Oct 19, 2015 at 04:21:08PM +0100, Catalin Marinas wrote:
> > On Mon, Oct 19, 2015 at 09:06:05AM +0200, Ingo Molnar wrote:
> > > * Peter Zijlstra <peterz@infradead.org> wrote:
> > >
> > > > In any case, its all moot now, since Paul no longer requires schedule() to imply
> > > > a full barrier.
> > > >
> > > > [...]
> > >
> > > Nevertheless from a least-surprise POV it might be worth guaranteeing it, because
> > > I bet there's tons of code that assumes that schedule() is a heavy operation and
> > > it's such an easy mistake to make. Since we are so close to having that guarantee,
> > > we might as well codify it?
> >
> > FWIW, the arm64 __switch_to() has a heavy barrier (DSB) but the reason
> > for this was to cope with potentially interrupted cache or TLB
> > maintenance (which require a DSB on the same CPU) and thread migration
> > to another CPU.
>
> Right, but there's a path through schedule() that does not pass through
> __switch_to(); when we pick the current task as the most eligible task
> and next == prev.
>
> In that case there really only is the wmb, a spin lock, an atomic op and
> a spin unlock (and a whole bunch of 'normal' code of course).
... and the 'normal' code will have a control hazard somewhere, followed
by the implicit ISB in exception return, so there's a barrier of sorts
there too.
The problem is that people say "full barrier" without defining what it
really means, and we end up going round the houses on things like
transitivity (which ctrl + isb doesn't always give you).
Will
next prev parent reply other threads:[~2015-10-27 16:19 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-16 15:18 Q: schedule() and implied barriers on arm64 Peter Zijlstra
2015-10-16 16:04 ` Paul E. McKenney
2015-10-16 16:16 ` Peter Zijlstra
2015-10-16 16:28 ` Paul E. McKenney
2015-10-16 16:39 ` Peter Zijlstra
2015-10-16 16:55 ` Catalin Marinas
2015-10-16 17:28 ` Paul E. McKenney
2015-10-16 19:07 ` Peter Zijlstra
2015-10-16 19:20 ` Paul E. McKenney
2015-10-19 15:18 ` Catalin Marinas
2015-10-16 19:06 ` Peter Zijlstra
2015-10-19 7:06 ` Ingo Molnar
2015-10-19 9:04 ` Peter Zijlstra
2015-10-19 15:21 ` Catalin Marinas
2015-10-19 16:24 ` Peter Zijlstra
2015-10-20 8:37 ` Ingo Molnar
2015-10-27 16:19 ` Will Deacon [this message]
2015-10-27 18:40 ` Peter Zijlstra
2015-10-28 10:39 ` Will Deacon
2015-10-16 17:11 ` Catalin Marinas
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=20151027161948.GE20208@arm.com \
--to=will.deacon@arm.com \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=torvalds@linux-foundation.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.