LWN.net Logo

Improving ticket spinlocks

Improving ticket spinlocks

Posted Jan 4, 2013 22:12 UTC (Fri) by zlynx (subscriber, #2285)
Parent article: Improving ticket spinlocks

How expensive are inter-processor interrupts? If they're cheaper than 50 cycles and a cache-line bounce then the thing to do would be to have the lock owner CPU look at the next ticket in line and send it an interrupt while the waiting CPU just sits in an idle. From what I could pick up in a fast Google an IPI is about the same as a cache line bounce, it is the register saves and all that make it more expensive. But since the waiting CPU is in a known state the code could probably skip all that and just resume with the lock acquire.


(Log in to post comments)

Improving ticket spinlocks

Posted Jan 10, 2013 15:18 UTC (Thu) by Otus (guest, #67685) [Link]

That would shift the cost to the uncontended case, since it would have to check whether someone is waiting.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds