On Mon, Feb 01, 2010 at 10:08:08AM +0100, Artur Grabowski wrote:
> Ariane van der Steldt <[email protected]> writes:
> 
> > Why are the pventries allocated from the kmem_map anyway? I think they
> > should be allocated using the uvm_km_getpage instead. Or even better,
> > from a pvpool like amd64.
> 
> Recursion.
> 
> caller holds lock on kernel_map. getpage pool is empty, caller wakes
> up the getpage thread, goes to sleep (still holding the kernel_map
> lock), getpage thread wakes up, deadlocks on the kernel_map lock. It's
> not an easily detectable recursion either, so we don't panic when it
> happens, we just hang.
> 
> amd64 can avoid it thanks to the direct map (no kernel_map involed when
> calling getpage).
> 
> We could try some magic with allocating from a pool with NOWAIT and
> then fall back to kmem_map when that fails, but the logic would become
> hairy. Maybe a pool allocator with those semantics?


I think the pool allocator is doable. Will look at it when I get a spare
hour or two (may be a while ;)

As a note, why are we even using pmap_enter for dmamem_map anyway? it's
a kernel only mapping that doesn't fault or anything, why not
pmap_kenter_pa? Or is the policy that if it's a managed page, it gets
normaly entered? Admittedly I should already know this...

-0-
-- 
Outside of a dog, a book is a man's best friend: and inside a dog,
it's too dark to read.
                -- Groucho Marx

Reply via email to