Re:3.7X speedup from removing a call to sleep
by cperciva on Sunday September 02, 2012 @09:01AM
(#4466909)
In FreeBSD the vast majority of sleep lock acquisitions are uncontended and end up being a single compare-and-exchange -- very fast. Spin locks are slightly more work, since we disable interrupts during them.
Re:3.7X speedup from removing a call to sleep
by raverbashing on Sunday September 02, 2012 @09:02AM
(#4466911)
Exactly
Spinlocks in linux are the "last resource locks", usually in kernel code only in situations where you can't have the scheduler kicking in but can have a race condition (in SMP systems usually)
So it's basically interrupt handlers.
http://kernel.org/doc/Documentation/spinlocks.txt