linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Andrea Parri <andrea.parri@amarulasolutions.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.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 13:04:36 +0200	[thread overview]
Message-ID: <20180328110436.GR4043@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <87a7us3h66.fsf@concordia.ellerman.id.au>

On Wed, Mar 28, 2018 at 04:25:37PM +1100, Michael Ellerman wrote:
> That was tempting, but it leaves unfixed all the other potential
> callers, both in in-tree and out-of-tree and in code that's yet to be
> written.

So I myself don't care one teeny tiny bit about out of tree code, they
get to keep their pieces :-)

> Looking today nearly all the callers are debug code, where we probably
> don't need the barrier but we also don't care about the overhead of the
> barrier.

Still, code like:

	WARN_ON_ONCE(!spin_is_locked(foo));

will unconditionally emit that SYNC. So you might want to be a little
careful.

> Documenting it would definitely be good, but even then I'd be inclined
> to leave the barrier in our implementation. Matching the documented
> behaviour is one thing, but the actual real-world behaviour on well
> tested platforms (ie. x86) is more important.

By that argument you should switch your spinlock implementation to RCpc
and include that SYNC in either lock or unlock already ;-)

Ideally we'd completely eradicate the *_is_locked() crud from the
kernel, not sure how feasable that really is, but it's a good goal. At
that point the whole issue of the barrier becomes moot of course.

  reply	other threads:[~2018-03-28 11:04 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
2018-03-28  5:25     ` Michael Ellerman
2018-03-28 11:04       ` Peter Zijlstra [this message]
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=20180328110436.GR4043@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).