All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Peter Zijlstra <peterz@infradead.org>,
	Nicholas Piggin <npiggin@gmail.com>
Cc: torvalds@linux-foundation.org, will.deacon@arm.com,
	oleg@redhat.com, paulmck@linux.vnet.ibm.com,
	benh@kernel.crashing.org, linux-kernel@vger.kernel.org,
	mingo@kernel.org, stern@rowland.harvard.edu,
	linuxppc-dev <linuxppc-dev@ozlabs.org>
Subject: Re: [RFC][PATCH 5/5] powerpc: Remove SYNC from _switch
Date: Thu, 08 Jun 2017 19:54:30 +1000	[thread overview]
Message-ID: <877f0mere1.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <20170608075720.kc2p3tybghzbmrz3@hirez.programming.kicks-ass.net>

Peter Zijlstra <peterz@infradead.org> writes:
> On Thu, Jun 08, 2017 at 05:29:38PM +1000, Nicholas Piggin wrote:
>> On Thu, 8 Jun 2017 08:54:00 +0200
>> Peter Zijlstra <peterz@infradead.org> wrote:
>> > 
>> > Right, so this patch relies on the smp_mb__before_spinlock ->
>> > smp_mb__after_spinlock conversion that makes the rq->lock RCsc and
>> > should thus provide the required SYNC for migrations.
>> 
>> AFAIKS either one will do, so long as there is a hwsync there. The
>> point is just that I have added some commentary in the generic and
>> powerpc parts to make it clear we're relying on that behavior of
>> the primitive. smp_mb* is not guaranteed to order MMIO, it's just
>> that it does on powerpc.
>
> I'm not particularly happy with the generic comment; I don't feel we
> should care that PPC is special here.

I think it'd be nice if there was *some* comment on the two uses of
smp_mb__after_spinlock(), it's fairly subtle, but I don't think it needs
to mention PPC specifically.


If we have:

arch/powerpc/include/asm/barrier.h:
+/*
+ * This must resolve to hwsync on SMP for the context switch path. See
+ * _switch.
+ */
 #define smp_mb__after_spinlock()   smp_mb()


And then something in _switch() that says "we rely on the
smp_mb__after_spinlock() in the scheduler core being a hwsync", that
should probably be sufficient.

cheers

  parent reply	other threads:[~2017-06-08  9:54 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07 16:15 [RFC][PATCH 0/5] Getting rid of smp_mb__before_spinlock Peter Zijlstra
2017-06-07 16:15 ` [RFC][PATCH 1/5] mm: Rework {set,clear,mm}_tlb_flush_pending() Peter Zijlstra
2017-06-09 14:45   ` Will Deacon
2017-06-09 18:42     ` Peter Zijlstra
2017-07-28 17:45     ` Peter Zijlstra
2017-08-01 10:31       ` Will Deacon
2017-08-01 12:02         ` Benjamin Herrenschmidt
2017-08-01 12:14           ` Peter Zijlstra
2017-08-01 16:39             ` Peter Zijlstra
2017-08-01 16:44               ` Will Deacon
2017-08-01 16:48                 ` Peter Zijlstra
2017-08-01 22:59                   ` Peter Zijlstra
2017-08-02  1:23                     ` Benjamin Herrenschmidt
2017-08-02  8:11                       ` Peter Zijlstra
2017-08-02  8:15                         ` Will Deacon
2017-08-02  8:43                           ` Will Deacon
2017-08-02  8:51                             ` Peter Zijlstra
2017-08-02  9:02                               ` Will Deacon
2017-08-02 22:54                                 ` Benjamin Herrenschmidt
2017-08-02  8:45                           ` Peter Zijlstra
2017-08-02  9:02                             ` Will Deacon
2017-08-02  9:18                               ` Peter Zijlstra
2017-08-02 13:57                         ` Benjamin Herrenschmidt
2017-08-02 15:46                           ` Peter Zijlstra
2017-08-02  0:17                   ` Benjamin Herrenschmidt
2017-08-01 22:42             ` Benjamin Herrenschmidt
2017-06-07 16:15 ` [RFC][PATCH 2/5] locking: Introduce smp_mb__after_spinlock() Peter Zijlstra
2017-06-07 16:15 ` [RFC][PATCH 3/5] overlayfs: Remove smp_mb__before_spinlock() usage Peter Zijlstra
2017-06-07 16:15 ` [RFC][PATCH 4/5] locking: Remove smp_mb__before_spinlock() Peter Zijlstra
2017-06-07 16:15 ` [RFC][PATCH 5/5] powerpc: Remove SYNC from _switch Peter Zijlstra
2017-06-08  0:32   ` Nicholas Piggin
2017-06-08  6:54     ` Peter Zijlstra
2017-06-08  7:29       ` Nicholas Piggin
2017-06-08  7:57         ` Peter Zijlstra
2017-06-08  8:21           ` Nicholas Piggin
2017-06-08  9:54           ` Michael Ellerman [this message]
2017-06-08 10:00             ` Nicholas Piggin
2017-06-08 12:45               ` Peter Zijlstra
2017-06-08 13:18                 ` Nicholas Piggin
2017-06-08 13:47                   ` Peter Zijlstra
2017-06-09 14:49 ` [RFC][PATCH 0/5] Getting rid of smp_mb__before_spinlock 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=877f0mere1.fsf@concordia.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mingo@kernel.org \
    --cc=npiggin@gmail.com \
    --cc=oleg@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=stern@rowland.harvard.edu \
    --cc=torvalds@linux-foundation.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 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.