Cleanup the vm_map_entry_[k]reserve/[k]release() API. This API is used to
authorMatthew Dillon <dillon@dragonflybsd.org>
Wed, 14 Jan 2004 23:26:14 +0000 (23:26 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Wed, 14 Jan 2004 23:26:14 +0000 (23:26 +0000)
commite135993399aedd98cc2e83e3b3ea23cbd868221f
tree25a2b01d3ebb39aac18584fc9417ba581aee8160
parent27c23c6b11f063071fad4cb460585c58c3dffd31
Cleanup the vm_map_entry_[k]reserve/[k]release() API.  This API is used to
guarentee that sufficient vm_map_entry structures are available for certain
atomci VM operations.

The kreserve/krelease API is only supposed to be used to dig into the kernel
reserve, used when zalloc() must recurse into kmem_alloc() in order to
allocate a new page.  Without this we can get into a kmem_alloc -> zalloc ->
kmem_alloc deadlock.

kreserve/krelease was being used improperly in my original work, causing it
to be unable to guarentee the reserve and resulting in an occassional panic.
This commit converts the improper usage back to using the non-k version of
the API and (should) properly handle the zalloc() recursion case.

Reported-by: David Rhodus <drhodus@catpa.com>
sys/vm/vm_contig.c
sys/vm/vm_extern.h
sys/vm/vm_glue.c
sys/vm/vm_kern.c
sys/vm/vm_kern.h
sys/vm/vm_map.c
sys/vm/vm_map.h
sys/vm/vm_zone.c