Subject: Re: Some interesting papers on BSD ...
To: Warner Losh <imp@village.org>
From: Charles M. Hannum <mycroft@mit.edu>
List: tech-kern
Date: 07/14/1996 20:20:33
Warner Losh <imp@village.org> writes:

> 
> How is that different from taking out fine grain locks?

At least in Dynix (as told to me by someone who works for Sequent),
the spl level is raised only on the processor that took the lock.
This protects an interrupt routine running on the same processor from
trying to lock the same object, and thus prevents deadlocks.  It also
means that the locks can simply do nothing for non-SMP systems.

The other relevant piece is that when an interrupt routine attempts to
grab a lock that is already being held, it spin-waits until the lock
is free.  Some would argue that this is expensive, but with tweaking
the duration that most locks are held can be made very small
(certainly cheaper than any mechanism to defer the interrupt if it
were allowed to run on the same CPU).