Subject: Re: lock bug in getnewvnode, or uvm_km_kmemalloc/uvm_map ?
To: Frank van der Linden <fvdl@wasabisystems.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 11/19/2002 20:38:00
On Tue, Nov 19, 2002 at 07:54:54PM +0100, Frank van der Linden wrote:
> On Tue, Nov 19, 2002 at 03:46:41PM +0100, Manuel Bouyer wrote:
> > getnewvnode() (the simple_lock is grabbed in getnewvnode)
> > pool_get(PR_NOWAIT)
> > pool_allocator_alloc()
> > pool_page_alloc_nointr()
> > uvm_km_alloc_poolpage1()
> > uvm_km_kmemalloc()
> > uvm_map()
> > pool_get(PR_WAITOK)
> 
> I remember posting about this a while ago to this list, and proposing
> a fix. Chuq at that time told me the fix was okay, but I never did
> implement it.

I was on 08/05/2002:
http://mail-index.netbsd.org/tech-kern/2002/08/05/0001.html

I though doing it too. uvm_km_kmemalloc() has the info, it just needs
to pass it to uvm_map(), and from here to uvm_mapent_alloc(). It's not
hard.
But I didn't know if there are other places where uvm_map() may sleep.
There is at last one, in vm_map_lock() if I trust the comment. We can probably
always pass UVM_FLAG_TRYLOCK for the nowait case.
Is pmap_growkernel() allowed to sleep ?


-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 23 ans d'experience feront toujours la difference
--