Subject: Re: newlock
To: Jason Thorpe <>
From: Chuck Silvers <>
List: tech-kern
Date: 09/24/2006 09:34:54
On Fri, Sep 08, 2006 at 09:49:34AM -0700, Jason Thorpe wrote:
> >>I don't think we should have adaptive vs. spin-only rwlocks.  Solaris
> >>only has sleeper-style rwlocks, and we ourselves only have  
> >>spinlockmgr
> >>() for a few special cases.
> >
> >I'd like to do that, it would remove a lot of complication. Looking  
> >at it
> >now, the proclist lock is easy enough to deal with, but some pmaps  
> >also use
> >spinlockmgr() and I'm not sure how to deal with those yet.
> Those can probably just become regular rwlocks ... I don't think there  
> any danger in letting those code paths sleep any longer.
> Chuq -- any comments on this?

you mean whether it would be ok for pmap_enter(), etc, to sleep?
currently we call pmap_enter() with spinlocks held, so we would 
need to fix that first (which would be a good cleanup anyway).

but I agree that we shouldn't have spin-only rwlocks.

> >Right, that was one of my goals. For LOCKDEBUG I'm tempted to argue  
> >but I
> >can think of a couple of ways around it.
> Eventually, I'd like LOCKDEBUG to be able to become a run-time boot  
> flag.  This can be arranged by cleverness in mutex_init().

I've wanted for a while to fix LOCKDEBUG so that it doesn't affect the ABI.
I hadn't thought through all the details yet though.