From a9bfe7a4b3a7951f08960288f53ed37cee271817 Mon Sep 17 00:00:00 2001 From: tegge Date: Sun, 14 Oct 2001 20:51:14 +0000 Subject: Don't remove all mappings of a swapped out process if the vm map contained wired entries. vm_fault_unwire() depends on the mapping being intact. Reviewed by: dillon --- sys/vm/vm_pageout.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sys/vm') diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index be7df98..76920a0 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); -- cgit v1.1