Subject: Re: newlock
To: Andrew Doran <ad@NetBSD.org>
From: David Laight <email@example.com>
Date: 09/02/2006 20:51:02
On Sat, Sep 02, 2006 at 04:22:15PM +0100, Andrew Doran wrote:
> The *_high() variants are a special case for the guts of the kernel where
> we need to release spin locks out of order. They aren't pretty, and I'm
> not sure if they should be documented for device drivers.
I'm not sure really solve the problem either.
Since netbsd uses splraise() - so we don't have any problem about acquiring
a lock enabling some interrupts - there is no real need for the lock variants.
The unlock versions really need to transfer the original spl level to the
second lock - or swap over the saved spl levels between two locks.
Otherwise it becomes very easy to get the spl level wrong.
Releasing locks out of order is very useful, for instance:
Plausably you want to allow lock(lookup_table) to sleep, but an ISR
to be able to lock(entry);
David Laight: firstname.lastname@example.org