Subject: Re: deadlock with sched_lock in SA code
To: Jason Thorpe <thorpej@shagadelic.org>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 09/19/2005 05:23:57
On Sun, Sep 18, 2005 at 06:45:36PM -0700, Jason Thorpe wrote:
> 
> On Sep 18, 2005, at 4:03 PM, Chuck Silvers wrote:
> 
> >it turned out that there was a similar problem with freeing a
> >struct sadata_upcall, pool_put() can also call wakeup().  to get  
> >around
> >this, I had sa_switch() free the structure after it sleeps instead  
> >of before.
> >this means we're hanging onto the structure for the duration of the  
> >sleep
> >for a lame reason, oh well.
> 
> Maybe we could free it to a private free list, and when upcalls are  
> allocated, we can just check the free list before calling pool_get 
> ().  That way we could actually use the straggler.

we could, but that would need either an extra lock, or some dance with
sched_lock if we would try to protect it with that, or some per-CPU list.
it doesn't seem worth the complexity.

and in general, I don't really like having extra layers of memory caching
on top of the pool caching, since those extra layers don't automatically
react to memory pressure like pools do.  we have a couple exceptions already
(buffer cache, kernel stacks), each with a special hook in the pagedaemon,
and I think we should avoid adding more unless there is a compelling reason.

-Chuck