Posted Sep 16, 2013 19:18 UTC (Mon) by vlovich (guest, #63271)
Parent article: Introducing lockrefs
Since spinlock is a single bit, why not merge the spinlock bit & the reference count? There are several benefits:
1) you are more likely to support more architectures since you don't need a 64-bit CAS.
2) the lockref structure uses half the space making it more cache-friendly & reducing the memory footprint of the kernel
3) you can use 32-bit CAS which presumably is faster than the 64-bit version
I know that there's more data that is shoved into the lower-half of the spincount for debugging purposes, but it seems like that stuff should actually go into a separate, optional variable.