summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_object.c
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1998-02-05 03:32:49 +0000
committerdyson <dyson@FreeBSD.org>1998-02-05 03:32:49 +0000
commitebccbfc1ff2783a90468a1caf1dcdec08e2cdfda (patch)
tree55a2e387681d3f8a086c24b5ee5f182df4318779 /sys/vm/vm_object.c
parentc552a9a1c3362d37fc1aaf3a9ba4231225b1f13a (diff)
downloadFreeBSD-src-ebccbfc1ff2783a90468a1caf1dcdec08e2cdfda.zip
FreeBSD-src-ebccbfc1ff2783a90468a1caf1dcdec08e2cdfda.tar.gz
1) Start using a cleaner and more consistant page allocator instead
of the various ad-hoc schemes. 2) When bringing in UPAGES, the pmap code needs to do another vm_page_lookup. 3) When appropriate, set the PG_A or PG_M bits a-priori to both avoid some processor errata, and to minimize redundant processor updating of page tables. 4) Modify pmap_protect so that it can only remove permissions (as it originally supported.) The additional capability is not needed. 5) Streamline read-only to read-write page mappings. 6) For pmap_copy_page, don't enable write mapping for source page. 7) Correct and clean-up pmap_incore. 8) Cluster initial kern_exec pagin. 9) Removal of some minor lint from kern_malloc. 10) Correct some ioopt code. 11) Remove some dead code from the MI swapout routine. 12) Correct vm_object_deallocate (to remove backing_object ref.) 13) Fix dead object handling, that had problems under heavy memory load. 14) Add minor vm_page_lookup improvements. 15) Some pages are not in objects, and make sure that the vm_page.c can properly support such pages. 16) Add some more page deficit handling. 17) Some minor code readability improvements.
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r--sys/vm/vm_object.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index dd3f27c..72c9658 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.109 1998/01/31 11:56:41 dyson Exp $
+ * $Id: vm_object.c,v 1.110 1998/02/04 22:33:50 eivind Exp $
*/
/*
@@ -93,9 +93,7 @@
#include <vm/vm_zone.h>
static void vm_object_qcollapse __P((vm_object_t object));
-#ifdef not_used
-static void vm_object_deactivate_pages __P((vm_object_t));
-#endif
+static void vm_object_dispose __P((vm_object_t));
/*
* Virtual memory objects maintain the actual data
@@ -249,7 +247,9 @@ vm_object_reference(object)
object->ref_count++;
if (object->type == OBJT_VNODE) {
while (vget((struct vnode *) object->handle, LK_RETRY|LK_NOOBJ, curproc)) {
+#if !defined(MAX_PERF)
printf("vm_object_reference: delay in getting object\n");
+#endif
}
}
}
@@ -381,6 +381,7 @@ doterm:
if (temp->ref_count == 0)
temp->flags &= ~OBJ_OPT;
temp->generation++;
+ object->backing_object = NULL;
}
vm_object_terminate(object);
/* unlocks and deallocates object */
@@ -418,7 +419,7 @@ vm_object_terminate(object)
#if defined(DIAGNOSTIC)
if (object->paging_in_progress != 0)
- panic("vm_object_deallocate: pageout in progress");
+ panic("vm_object_terminate: pageout in progress");
#endif
/*
@@ -441,28 +442,34 @@ vm_object_terminate(object)
vp = (struct vnode *) object->handle;
vinvalbuf(vp, V_SAVE, NOCRED, NULL, 0, 0);
- } else {
+ } else if (object->type != OBJT_DEAD) {
/*
* Now free the pages. For internal objects, this also removes them
* from paging queues.
*/
while ((p = TAILQ_FIRST(&object->memq)) != NULL) {
+#if !defined(MAX_PERF)
if (p->busy || (p->flags & PG_BUSY))
printf("vm_object_terminate: freeing busy page\n");
+#endif
p->flags |= PG_BUSY;
vm_page_free(p);
cnt.v_pfree++;
}
+
}
- /*
- * Let the pager know object is dead.
- */
- vm_pager_deallocate(object);
+ if (object->type != OBJT_DEAD) {
+ /*
+ * Let the pager know object is dead.
+ */
+ vm_pager_deallocate(object);
+ }
if (object->ref_count == 0) {
- vm_object_dispose(object);
+ if ((object->type != OBJT_DEAD) || (object->resident_page_count == 0))
+ vm_object_dispose(object);
}
}
@@ -471,7 +478,7 @@ vm_object_terminate(object)
*
* Dispose the object.
*/
-void
+static void
vm_object_dispose(object)
vm_object_t object;
{
OpenPOWER on IntegriCloud