Subject: Re: lock bug in getnewvnode, or uvm_km_kmemalloc/uvm_map ?
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 11/20/2002 19:52:19
On Tue, Nov 19, 2002 at 03:46:41PM +0100, Manuel Bouyer wrote:
> uvm_km_kmemalloc() is properly called with UVM_KMF_NOWAIT.
> But uvm_map() is called with flags stripped to UVM_KMF_TRYLOCK, so
> UVM_KMF_NOWAIT is lost here.
> Second problem, uvm_mapent_alloc() called from uvm_map() will call
> pool_get(PR_WAITOK) unconditionally. It seems to me that uvm_map() was not
> designed to be called from a context where we can sleep, but I may be
> wrong.
passing UVM_KMF_NOWAIT through to uvm_map() is probably the right approach.
then uvm_map() can propogate that to its children, so everyone can do the
right thing. this will involve adding extra arguments to uvm_mapent_alloc(),
and possibly others.
> So there is a problem for the PR_NOWAIT case, because we may, from
> here, call uvm_map() and a pool_get(PR_WAITOK). Or maybe PR_NOWAIT should
> only be used for pools with special memory allocators ?
we should make PR_NOWAIT work on all pools.
could you come up with some diffs for this?
hopefully it's not a very big change.
-Chuck