On Tue, Mar 12, 2013 at 01:31:21PM +1100, matthew green wrote:
>
> > > Modified Files:
> > > src/sys/kern: subr_pool.c
> > >
> > > Log Message:
> > > In pool_cache_put_slow(), pool_get() can block (it does mutex_enter()),
> > > so we need to retry if curlwp took a context switch during the call.
> >
> > I didn't think mutex_enter() blocked - isn't it a spinlock.
> > Which means that if things are going wrong they can go wrong
> > even if the mutex is available immediately.
>
> netbsd kernel mutexes can be either, but this one is a spinlock yeah.
Hmmm I thought that internal test had gone with lockmgr :-)
My guess is that every call site knows whether sleeping is allowed,
so it could be a property of the mutex type.
Then there would be no confusion about whether the code might sleep.
I know the uncontended path is now common to both (and fast) - unlike
lockmgr which took a couple of 100 instructions to decide what to do.
David
--
David Laight: da...@l8s.co.uk