To: None <firstname.lastname@example.org>
From: Andrew Doran <ad@NetBSD.org>
Date: 09/02/2006 16:22:15
I have been doing a bit of work on the newlock primatives that Jason
Thorpe added a few years back. I'd appreciate some constructive review
of the API before I start checking things in. I have put a couple of
draft manual pages for the primatives here:
These would be used to replace splfoo()/simple_lock(), spinlockmgr()
and outside of VFS, lockmgr().
Note that in the non-DIAGNOSTIC / MULTIPROCESSOR case, the spin locks
basically boil down to at most splraiseipl()/splx(). The adaptive locks
remain, however. I don't see that as a big problem: if an architecture
implements the basic lock stubs, the common case of acquiring or releasing
a lock is cheap: perhaps 10 or so instructions. For an example of memory
usage, on i386 a mutex is 4 bytes and a RW lock is 16 bytes.
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.