LWN.net Logo

What about separating locks and data?

What about separating locks and data?

Posted Jan 5, 2013 18:07 UTC (Sat) by PaulMcKenney (subscriber, #9624)
In reply to: What about separating locks and data? by corbet
Parent article: Improving ticket spinlocks

Putting the lock and the data together increases performance at low levels of lock contention. After all, if the lock and data are in separate cache lines, you will take two cache misses, whereas if the lock and data are in the same cache line, you will only take one cache miss.

Of course, and noted earlier in this thread, the opposite holds true at high levels of contention. Life is like that sometimes! ;-)


(Log in to post comments)

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