Thread (23 messages) 23 messages, 6 authors, 2014-02-10

Re: [PATCH] Convert powerpc simple spinlocks into ticket locks

flat view

From: Torsten Duwe <hidden>
Date: 2014-02-07 12:57:00
Also in: lkml

On Fri, Feb 07, 2014 at 11:45:30AM +0100, Peter Zijlstra wrote:
That might need to be lhz too, I'm confused on all the load variants.
;-)
quoted
unlock:
	lhz	%0, 0, &tail
	addic	%0, %0, 1
No carry with this one, I'd say.
Besides, unlock increments the head.
quoted
	lwsync
	sth	%0, 0, &tail
Given the beauty and simplicity of this, may I ask Ingo:
you signed off 314cdbefd1fd0a7acf3780e9628465b77ea6a836;
can you explain why head and tail must live on the same cache
line? Or is it just a space saver? I just ported it to ppc,
I didn't think about alternatives.

What about

atomic_t tail;
volatile int head; ?

Admittedly, that's usually 8 bytes instead of 4...

	Torsten
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help