diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index be7df98e04b8..76920a0c2e9b 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -544,6 +544,7 @@ vm_pageout_map_deactivate_pages(map, desired) { vm_map_entry_t tmpe; vm_object_t obj, bigobj; + int nothingwired; GIANT_REQUIRED; if (lockmgr(&map->lock, LK_EXCLUSIVE | LK_NOWAIT, (void *)0, curthread)) { @@ -551,6 +552,7 @@ vm_pageout_map_deactivate_pages(map, desired) } bigobj = NULL; + nothingwired = TRUE; /* * first, search out the biggest object, and try to free pages from @@ -566,6 +568,8 @@ vm_pageout_map_deactivate_pages(map, desired) bigobj = obj; } } + if (tmpe->wired_count > 0) + nothingwired = FALSE; tmpe = tmpe->next; } @@ -592,7 +596,7 @@ vm_pageout_map_deactivate_pages(map, desired) * Remove all mappings if a process is swapped out, this will free page * table pages. */ - if (desired == 0) + if (desired == 0 && nothingwired) pmap_remove(vm_map_pmap(map), VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS); vm_map_unlock(map);