News for hackers. Stuff that matters.
Re:3.7X speedup from removing a call to sleep by planckscnst on Sunday September 02, 2012 @08:21AM (#4466850)
They are encouraged in the Linux kernel in places where it is nessesary to lock for a very short time. Using mutexes takes a bit of overhead, so they can't give you very short sleep times; that is when spinlocks have to be used.

http://kernel.org/doc/Documentation/spinlocks.txt

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.