summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_kern.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-12-15 21:09:09 +0000
committeralc <alc@FreeBSD.org>2002-12-15 21:09:09 +0000
commitfe836ef10b498f3d4f88f99294fabc23754ab119 (patch)
tree028691ccadd9ad2b665550747ad3c64992ec38ac /sys/vm/vm_kern.c
parent233f99ac853934697c268615c66bbf40d63568a1 (diff)
downloadFreeBSD-src-fe836ef10b498f3d4f88f99294fabc23754ab119.zip
FreeBSD-src-fe836ef10b498f3d4f88f99294fabc23754ab119.tar.gz
Perform vm_object_lock() and vm_object_unlock() on kmem_object
around vm_page_lookup() and vm_page_free().
Diffstat (limited to 'sys/vm/vm_kern.c')
-rw-r--r--sys/vm/vm_kern.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c
index 12608a6..18c7d50 100644
--- a/sys/vm/vm_kern.c
+++ b/sys/vm/vm_kern.c
@@ -384,11 +384,13 @@ retry:
*/
while (i != 0) {
i -= PAGE_SIZE;
+ vm_object_lock(kmem_object);
m = vm_page_lookup(kmem_object,
OFF_TO_IDX(offset + i));
vm_page_lock_queues();
vm_page_free(m);
vm_page_unlock_queues();
+ vm_object_unlock(kmem_object);
}
vm_map_delete(map, addr, addr + size);
vm_map_unlock(map);
@@ -420,7 +422,9 @@ retry:
* splimp...)
*/
for (i = 0; i < size; i += PAGE_SIZE) {
+ vm_object_lock(kmem_object);
m = vm_page_lookup(kmem_object, OFF_TO_IDX(offset + i));
+ vm_object_unlock(kmem_object);
vm_page_lock_queues();
vm_page_wire(m);
vm_page_wakeup(m);
OpenPOWER on IntegriCloud