Subject: Re: Pulling simple syscalls out from the giant lock
To: David Laight <david@l8s.co.uk>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-kern
Date: 06/09/2005 09:19:01
On Jun 9, 2005, at 12:05 AM, David Laight wrote:

> I suspect we'll have to use either the Unixware or Solaris semantics.
>
> Unixware:  lock = lock_alloc(); oldpl = getlock(lock, newpl);
> Solaris:   lock = lock_alloc(newpl); getlock(lock);

The Solaris model is what I implemented years ago on the "newlock"  
branch.

>
> Exposing the pl to the locking primitives allows the useful sequence:
>     pl = getlock(table_lock, newpl);
>     item = lookup(table,...);
>     unlock(table_lock, getlock(item->lock, newpl));
>     ....
>     unlock(item->lock, pl);
>
> (the table_lock migth be a read_write lock, and the item->lock a  
> simple lock)
>
> The above is difficult to do on solaris.
>
> The actual solaris interface makes it very hard to create code that  
> can be
> called by ISRs - since you need the IRQ not the IPL when creating  
> the lock.

Not true.  The IPL is all that is needed.  Trust me, I've implemented  
it.

-- thorpej