From: Andrea Parri <andrea.parri@amarulasolutions.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH for-4.17 2/2] powerpc: Remove smp_mb() from arch_spin_is_locked()
Date: Wed, 28 Mar 2018 11:17:36 +0200 [thread overview]
Message-ID: <20180328091736.GA30906@andrea> (raw)
In-Reply-To: <1522187495.7364.70.camel@kernel.crashing.org>
On Wed, Mar 28, 2018 at 08:51:35AM +1100, Benjamin Herrenschmidt wrote:
> On Tue, 2018-03-27 at 15:13 +0200, Andrea Parri wrote:
> > >
> > > So unless it's very performance sensitive, I'd rather have things like
> > > spin_is_locked be conservative by default and provide simpler ordering
> > > semantics.
> >
> > Well, it might not be "very performance sensitive" but allow me to say
> > that "40+ SYNCs in stuff like BUG_ON or such" is sadness to my eyes ;),
>
> In the fast path or the trap case ? Because the latter doesn't matter
> at all...
Both: you must execute the sync "before" issuing the load of lock.slock.
>
> > especially when considered that our "high level API" provides means to
> > avoid this situation (e.g., smp_mb__after_spinlock(); BTW, if you look
> > at architectures for which this macro is "non-trivial", you can get an
> > idea of the architectures which "wouldn't work"; of course, x86 is not
> > among these). Yes, we do appear to have different views on what is to
> > be considered the "simpler ordering semantics". I'm willing to change
> > mine _as soon as_ this gets documented: would you be willing to send a
> > patch (on the lines of my [1]) to describe/document such semantics?
>
> Not really :-) Just expressing an opinion. I don't fully object to your
> approach, just saying it's open for debate.
Always (open for debate).
I'm sending a v2 of this series shortly, integrating some feedback;
I prefer to keep this patch in the series (feel free to ignore).
Andrea
>
> At this point, I have too many other things to chase to follow up too
> much on this.
>
> Cheers,
> Ben.
>
next prev parent reply other threads:[~2018-03-28 9:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-26 10:37 [PATCH for-4.17 2/2] powerpc: Remove smp_mb() from arch_spin_is_locked() Andrea Parri
2018-03-27 0:06 ` Benjamin Herrenschmidt
2018-03-27 10:25 ` Andrea Parri
2018-03-27 11:33 ` Benjamin Herrenschmidt
2018-03-27 13:13 ` Andrea Parri
2018-03-27 21:51 ` Benjamin Herrenschmidt
2018-03-28 9:17 ` Andrea Parri [this message]
2018-03-28 5:25 ` Michael Ellerman
2018-03-28 11:04 ` Peter Zijlstra
2018-03-28 11:08 ` Peter Zijlstra
2018-04-04 10:28 ` Michael Ellerman
2018-04-04 10:28 ` Michael Ellerman
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=20180328091736.GA30906@andrea \
--to=andrea.parri@amarulasolutions.com \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--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.