From: Scott Wood <scottwood@freescale•com>
To: Torsten Duwe <duwe@lst•de>
Cc: Peter Zijlstra <peterz@infradead•org>,
linux-kernel@vger•kernel.org, Paul Mackerras <paulus@samba•org>,
Anton Blanchard <anton@samba•org>,
"Paul E. McKenney" <paulmck@linux•vnet.ibm.com>,
linuxppc-dev@lists•ozlabs.org, Ingo Molnar <mingo@kernel•org>
Subject: Re: [PATCH] Convert powerpc simple spinlocks into ticket locks
Date: Thu, 6 Feb 2014 14:19:52 -0600 [thread overview]
Message-ID: <1391717992.6733.232.camel@snotra.buserror.net> (raw)
In-Reply-To: <20140206173727.GA13048@lst.de>
On Thu, 2014-02-06 at 18:37 +0100, Torsten Duwe wrote:
> On Thu, Feb 06, 2014 at 05:38:37PM +0100, Peter Zijlstra wrote:
> > On Thu, Feb 06, 2014 at 11:37:37AM +0100, Torsten Duwe wrote:
> > > x86 has them, MIPS has them, ARM has them, even ia64 has them:
> > > ticket locks. They reduce memory bus and cache pressure especially
> > > for contended spinlocks, increasing performance.
> > >
> > > This patch is a port of the x86 spin locks, mostly written in C,
> > > to the powerpc, introducing inline asm where needed. The pSeries
> > > directed yield for vCPUs is taken care of by an additional "holder"
> > > field in the lock.
> > >
> >
> > A few questions; what's with the ppc64 holder thing? Not having a 32bit
> > spinlock_t is sad.
>
> I must admit that I haven't tested the patch on non-pseries ppc64 nor on
> ppc32. Only ppc64 has the ldarx and I tried to atomically replace the
> holder along with the locks. That might prove unneccessary.
Why is the functionality of holder only required on 64-bit? We have too
many 32/64 differences as is. Perhaps on 32-bit a lower max number of
CPUs could be assumed, to make it fit in one word.
> > Can you pair lwarx with sthcx ? I couldn't immediately find the answer
> > in the PowerISA doc. If so I think you can do better by being able to
> > atomically load both tickets but only storing the head without affecting
> > the tail.
>
> V2.06b, Book II, Chapter 3, "sthcx" says:
> | If a reservation exists and the length associated [...] is not 2 bytes,
> | it is undefined whether (RS)_48:63 are stored [...]
>
> That doesn't make me feel comfortable :(
Plus, sthcx doesn't exist on all PPC chips.
-Scott
next prev parent reply other threads:[~2014-02-06 20:20 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-06 10:37 [PATCH] Convert powerpc simple spinlocks into ticket locks Torsten Duwe
2014-02-06 15:53 ` Benjamin Herrenschmidt
2014-02-06 16:38 ` Peter Zijlstra
2014-02-06 17:37 ` Torsten Duwe
2014-02-06 18:08 ` Peter Zijlstra
2014-02-06 19:28 ` Tom Musta
2014-02-10 2:54 ` Benjamin Herrenschmidt
2014-02-07 8:24 ` Torsten Duwe
2014-02-06 20:19 ` Scott Wood [this message]
2014-02-07 9:02 ` Torsten Duwe
2014-02-07 10:31 ` Peter Zijlstra
2014-02-07 10:36 ` Peter Zijlstra
2014-02-07 10:45 ` Peter Zijlstra
2014-02-07 11:49 ` Torsten Duwe
2014-02-07 12:28 ` Peter Zijlstra
2014-02-07 15:18 ` Peter Zijlstra
2014-02-07 15:43 ` Peter Zijlstra
2014-02-07 17:08 ` Torsten Duwe
2014-02-07 17:19 ` Peter Zijlstra
2014-02-07 15:51 ` Kumar Gala
2014-02-07 16:10 ` Peter Zijlstra
2014-02-10 3:05 ` Benjamin Herrenschmidt
2014-02-10 3:02 ` Benjamin Herrenschmidt
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=1391717992.6733.232.camel@snotra.buserror.net \
--to=scottwood@freescale$(echo .)com \
--cc=anton@samba$(echo .)org \
--cc=duwe@lst$(echo .)de \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=mingo@kernel$(echo .)org \
--cc=paulmck@linux$(echo .)vnet.ibm.com \
--cc=paulus@samba$(echo .)org \
--cc=peterz@infradead$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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