[PATCH] Convert powerpc simple spinlocks into ticket locks

Peter Zijlstra peterz at infradead.org
Fri Feb 7 21:36:13 EST 2014


> So if you have ll/sc on the whole word concurrent with the half-word
> store, you can loose the half-word store like:
> 
>   lwarx &tickets
>   ...			sth &tail
>   stwcd &tickets
> 
> 
> The stwcd will over-write the tail store.

Oh wait, that's stupid, it will invalidate the lock and fail the store
and make it try again, so you could try and combine the load, but you'd
need an extra shift instruction instead of an extra load.

Not sure that's a valid trade-off..


More information about the Linuxppc-dev mailing list