Re: [rfc][patch] queued spinlocks (i386)

From: Davide Libenzi
Date: Wed Mar 28 2007 - 18:00:43 EST


On Wed, 28 Mar 2007, Davide Libenzi wrote:

> On Wed, 28 Mar 2007, Nick Piggin wrote:
>
> > On Sat, Mar 24, 2007 at 06:29:59PM +0100, Ingo Molnar wrote:
> > >
> > > * Nikita Danilov <nikita@xxxxxxxxxxxxx> wrote:
> > >
> > > > Indeed, this technique is very well known. E.g.,
> > > > http://citeseer.ist.psu.edu/anderson01sharedmemory.html has a whole
> > > > section (3. Local-spin Algorithms) on them, citing papers from the
> > > > 1990 onward.
> > >
> > > that is a cool reference! So i'd suggest to do (redo?) the patch based
> > > on those concepts and that terminology and not use 'queued spinlocks'
> > > that are commonly associated with MS's stuff. And as a result the
> > > contended case would be optimized some more via local-spin algorithms.
> > > (which is not a key thing for us, but which would be nice to have
> > > nevertheless)
> >
> > Firstly, the terminology in that paper _is_ "queue lock", which isn't
> > really surprising. I don't really know or care about what MS calls their
> > locks, but I'd suggest that their queued spinlock is probably named in
> > reference to its queueing property rather than its local spin property.
>
> The method you propose is otherwise called "Ticket Lock":
>
> http://en.wikipedia.org/wiki/Ticket_lock
> http://www.cs.rochester.edu/research/synchronization/pseudocode/ss.html#ticket

That this work prio-art dates to 1991:

http://www.cs.rochester.edu/u/scott/papers/1991_TOCS_synch.pdf

So I would not worry to much about patents here. At least W2K MS ones ;)
What I would worry though, is to add another class of locks. There's no
reason why Ticket Locks would perform worse than our spinlock, in both
contended and not-contended case, AFAICS. And they have a nice FIFO
behaviour.



- Davide


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/