All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: xinhui <xinhui.pan@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	virtualization@lists.linux-foundation.org, paulus@samba.org,
	mpe@ellerman.id.au, mingo@redhat.com, paulmck@linux.vnet.ibm.com,
	waiman.long@hpe.com
Subject: Re: [PATCH v5 1/6] qspinlock: powerpc support qspinlock
Date: Tue, 07 Jun 2016 07:41:37 +1000	[thread overview]
Message-ID: <1465249297.4274.72.camel@kernel.crashing.org> (raw)
In-Reply-To: <20160606155907.GH30909@twins.programming.kicks-ass.net>

On Mon, 2016-06-06 at 17:59 +0200, Peter Zijlstra wrote:
> On Fri, Jun 03, 2016 at 02:33:47PM +1000, Benjamin Herrenschmidt wrote:
> > 
> >  - For the above, can you show (or describe) where the qspinlock
> >    improves things compared to our current locks.
> So currently PPC has a fairly straight forward test-and-set spinlock
> IIRC. You have this because LPAR/virt muck and lock holder preemption
> issues etc..
> qspinlock is 1) a fair lock (like ticket locks) and 2) provides
> out-of-word spinning, reducing cacheline pressure.

Thanks Peter. I think I understand the theory, but I'd like see it
translate into real numbers.

> Esp. on multi-socket x86 we saw the out-of-word spinning being a big win
> over our ticket locks.
> 
> And fairness, brought to us by the ticket locks a long time ago,
> eliminated starvation issues we had, where a spinner local to the holder
> would 'always' win from a spinner further away. So under heavy enough
> local contention, the spinners on 'remote' CPUs would 'never' get to own
> the lock.

I think our HW has tweaks to avoid that from happening with the simple
locks in the underlying ll/sc implementation. In any case, what I'm
asking is actual tests to verify it works as expected for us.

> pv-qspinlock tries to preserve the fairness while allowing limited lock
> stealing and explicitly managing which vcpus to wake.

Right.
> > 
> > 	While there's
> >    theory and to some extent practice on x86, it would be nice to
> >    validate the effects on POWER.
> Right; so that will have to be from benchmarks which I cannot help you
> with ;-)

Precisely :-) This is what I was asking for ;-)

Cheers,
Ben.

WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: mpe@ellerman.id.au, linux-kernel@vger.kernel.org,
	waiman.long@hpe.com, virtualization@lists.linux-foundation.org,
	mingo@redhat.com, paulus@samba.org,
	xinhui <xinhui.pan@linux.vnet.ibm.com>,
	paulmck@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v5 1/6] qspinlock: powerpc support qspinlock
Date: Tue, 07 Jun 2016 07:41:37 +1000	[thread overview]
Message-ID: <1465249297.4274.72.camel@kernel.crashing.org> (raw)
In-Reply-To: <20160606155907.GH30909@twins.programming.kicks-ass.net>

On Mon, 2016-06-06 at 17:59 +0200, Peter Zijlstra wrote:
> On Fri, Jun 03, 2016 at 02:33:47PM +1000, Benjamin Herrenschmidt wrote:
> > 
> >  - For the above, can you show (or describe) where the qspinlock
> >    improves things compared to our current locks.
> So currently PPC has a fairly straight forward test-and-set spinlock
> IIRC. You have this because LPAR/virt muck and lock holder preemption
> issues etc..
> qspinlock is 1) a fair lock (like ticket locks) and 2) provides
> out-of-word spinning, reducing cacheline pressure.

Thanks Peter. I think I understand the theory, but I'd like see it
translate into real numbers.

> Esp. on multi-socket x86 we saw the out-of-word spinning being a big win
> over our ticket locks.
> 
> And fairness, brought to us by the ticket locks a long time ago,
> eliminated starvation issues we had, where a spinner local to the holder
> would 'always' win from a spinner further away. So under heavy enough
> local contention, the spinners on 'remote' CPUs would 'never' get to own
> the lock.

I think our HW has tweaks to avoid that from happening with the simple
locks in the underlying ll/sc implementation. In any case, what I'm
asking is actual tests to verify it works as expected for us.

> pv-qspinlock tries to preserve the fairness while allowing limited lock
> stealing and explicitly managing which vcpus to wake.

Right.
> > 
> > 	While there's
> >    theory and to some extent practice on x86, it would be nice to
> >    validate the effects on POWER.
> Right; so that will have to be from benchmarks which I cannot help you
> with ;-)

Precisely :-) This is what I was asking for ;-)

Cheers,
Ben.

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2016-06-06 22:16 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-02  9:22 [PATCH v5 0/6] powerPC/pSeries use pv-qpsinlock as the default spinlock implemention Pan Xinhui
2016-06-02  9:22 ` Pan Xinhui
2016-06-02  9:22 ` Pan Xinhui
2016-06-02  9:22   ` Pan Xinhui
2016-06-02  9:22 ` [PATCH v5 1/6] qspinlock: powerpc support qspinlock Pan Xinhui
2016-06-02  9:22   ` Pan Xinhui
2016-06-03  1:32   ` Benjamin Herrenschmidt
2016-06-03  1:32     ` Benjamin Herrenschmidt
2016-06-03  1:32     ` Benjamin Herrenschmidt
2016-06-03  4:10       ` xinhui
2016-06-03  4:33         ` Benjamin Herrenschmidt
2016-06-03  4:33           ` Benjamin Herrenschmidt
2016-06-03  7:02           ` xinhui
2016-06-03  7:02             ` xinhui
2016-06-06 15:59           ` Peter Zijlstra
2016-06-06 15:59             ` Peter Zijlstra
2016-06-06 21:41             ` Benjamin Herrenschmidt [this message]
2016-06-06 21:41               ` Benjamin Herrenschmidt
2016-06-21 12:35               ` xinhui
2016-06-21 12:35                 ` xinhui
2016-06-03  4:10       ` xinhui
2016-06-03  1:32   ` Benjamin Herrenschmidt
2016-06-02  9:22 ` [PATCH v5 2/6] powerpc: pseries/Kconfig: Add qspinlock build config Pan Xinhui
2016-06-02  9:22   ` Pan Xinhui
2016-06-02  9:22 ` [PATCH v5 3/6] powerpc: lib/locks.c: Add cpu yield/wake helper function Pan Xinhui
2016-06-02  9:22   ` Pan Xinhui
2016-06-02  9:22 ` [PATCH v5 4/6] pv-qspinlock: powerpc support pv-qspinlock Pan Xinhui
2016-06-02  9:22 ` Pan Xinhui
2016-06-02  9:22 ` [PATCH v5 5/6] pv-qspinlock: use cmpxchg_release in __pv_queued_spin_unlock Pan Xinhui
2016-06-02  9:22 ` Pan Xinhui
2016-06-02  9:22 ` [PATCH v5 6/6] powerpc: pseries: Add pv-qspinlock build config/make Pan Xinhui
2016-06-02  9:22 ` Pan Xinhui
  -- strict thread matches above, loose matches on Subject: below --
2016-06-02  9:26 [PATCH v5 0/6] powerPC/pSeries use pv-qpsinlock as the default spinlock implemention Pan Xinhui
2016-06-02  9:26 ` [PATCH v5 1/6] qspinlock: powerpc support qspinlock Pan Xinhui
2016-06-02  9:26   ` Pan Xinhui

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=1465249297.4274.72.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=waiman.long@hpe.com \
    --cc=xinhui.pan@linux.vnet.ibm.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.