summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1998-10-23 05:25:49 +0000
committerdg <dg@FreeBSD.org>1998-10-23 05:25:49 +0000
commit599836ef434a6f0153f080a69ccb802ff9a92aa0 (patch)
treeac60d115873eb59a979de91fedb43ce612e30d6b /sys/vm
parent123c4e574210364558b003c3b4308600a6cbdf16 (diff)
downloadFreeBSD-src-599836ef434a6f0153f080a69ccb802ff9a92aa0.zip
FreeBSD-src-599836ef434a6f0153f080a69ccb802ff9a92aa0.tar.gz
Fixed two bugs in recent commit: in vm_object_terminate, vm_pager_dealloc
needs to be called prior to freeing remaining pages in the object so that the device pager has an opportunity to grab its "fake" pages. Also, in the case of wired pages, the page must be made busy prior to calling vm_page_remove. This is a difference from 2.2.x that I overlooked when I brought these changes forward.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_object.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index c60ede2..2228e4b 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_object.c,v 1.129 1998/09/28 02:40:11 dg Exp $
+ * $Id: vm_object.c,v 1.130 1998/10/22 02:16:53 dg Exp $
*/
/*
@@ -446,9 +446,14 @@ vm_object_terminate(object)
panic("vm_object_terminate: object with references, ref_count=%d", object->ref_count);
/*
- * Now free the pages. For internal objects, this also removes them
- * from paging queues. Don't free wired pages, just remove them
- * from the object.
+ * Let the pager know object is dead.
+ */
+ vm_pager_deallocate(object);
+
+ /*
+ * Now free any remaining pages. For internal objects, this also
+ * removes them from paging queues. Don't free wired pages, just
+ * remove them from the object.
*/
while ((p = TAILQ_FIRST(&object->memq)) != NULL) {
#if !defined(MAX_PERF)
@@ -461,13 +466,10 @@ vm_object_terminate(object)
cnt.v_pfree++;
} else {
printf("vm_object_terminate: not freeing wired page; wire_count=%d\n", p->wire_count);
+ vm_page_busy(p);
vm_page_remove(p);
}
}
- /*
- * Let the pager know object is dead.
- */
- vm_pager_deallocate(object);
/*
* Remove the object from the global object list.
OpenPOWER on IntegriCloud