string. The actual functional changes are:
1. in vm_page_alloc(), restore some long lost code by Paul Kranenburg
that reserves the last few pages for kernel objects, adding an
additional escape for the pageout daemon.
2. In vm_wait() (replaces VM_WAIT), recognize the amusing fatal
deadlock where the pagedemon sleeps on a channel that only it ever
wakes up, and add a timeout and printf. Mod 1 should generally
prevent this from happening in any case.
3. Fix a livelock in vm_pageout_page() caused by a pre-wakeup of
page consumers prior to the pageout, which can easily fail over
memory issues in NFS and IP code. Also, ++ cnt.v_pageouts only
if the pageout succeeded.
Unlock the object cache before looking for collapse candidates.
Use vm_object_lock_try() to obtain a lock on a collapse candidate.
This avoids a deadlock due to recursively entering
vm_object_deallocate() in case a backing object goes away.
vm_object_collapse() and helper functions:
The object passed in is locked; make sure it is locked when
we leave vm_object_collapse().
XXX: Currently, the object is not unlocked during while we possibly
wait for pager data. We need to consider the effects of
simultaneous calls to vm_object_collapse() on the same object
in case unlocking is necessary.
to describe here. This should fix the problems with "hanging processes"
people have seen since the original object collapse code was committed.
From Charles Hannum <mycroft@netbsd.org>
Create macros (with names borrowed from Mach 3) to manipulate
object->paging_in_progress, and use them. When decreasing the
paging count, always make sure to wake up anyone waiting.
Fixes `vospgc', `vosca1', and `vosca2' hangs.
Make vm_object_prefer() call MD aligner for "pageless" objects too,
so we can have more control over the virtual address to be used.
Implementation could be simpler if we by-pass the object to mapped, but
we'd loose the ability to adapt alignment to objects that were previously
mmap'ed with MAP_FIXED on.
locked page. Make that work. This also obviates the need for vm_fault() to
bogusly activate a page before deactivating it. Finally, make sure the
semantics of vm_object_deactive_pages() don't change.