Acquire and release the page queues lock around pmap_remove_pages() because

it updates several of vm_page's fields.
This commit is contained in:
Alan Cox 2002-11-25 04:37:44 +00:00
parent 37efca486e
commit 2d21129db2
2 changed files with 5 additions and 0 deletions

View File

@ -843,8 +843,10 @@ exec_new_vmspace(imgp, sv)
vm_map_max(map) == sv->sv_maxuser) {
if (vmspace->vm_shm)
shmexit(p);
vm_page_lock_queues();
pmap_remove_pages(vmspace_pmap(vmspace), vm_map_min(map),
vm_map_max(map));
vm_page_unlock_queues();
vm_map_remove(map, vm_map_min(map), vm_map_max(map));
} else {
vmspace_exec(p, sv->sv_minuser, sv->sv_maxuser);

View File

@ -76,6 +76,7 @@
#include <vm/vm_param.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <vm/vm_page.h>
#include <vm/uma.h>
#include <sys/user.h>
@ -290,8 +291,10 @@ exit1(td, rv)
if (--vm->vm_refcnt == 0) {
if (vm->vm_shm)
shmexit(p);
vm_page_lock_queues();
pmap_remove_pages(vmspace_pmap(vm), vm_map_min(&vm->vm_map),
vm_map_max(&vm->vm_map));
vm_page_unlock_queues();
(void) vm_map_remove(&vm->vm_map, vm_map_min(&vm->vm_map),
vm_map_max(&vm->vm_map));
vm->vm_freer = p;