diff options
author | dyson <dyson@FreeBSD.org> | 1998-01-12 01:46:33 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1998-01-12 01:46:33 +0000 |
commit | d9d8bf6d30a04d79ca9d60f80000053eb3f8b46d (patch) | |
tree | 10eadac88cb07ecf3dc243b80c17784560678271 /sys/vm/vm_page.c | |
parent | e790f0b45536af6e666eb06f1c410cb84ee8733c (diff) | |
download | FreeBSD-src-d9d8bf6d30a04d79ca9d60f80000053eb3f8b46d.zip FreeBSD-src-d9d8bf6d30a04d79ca9d60f80000053eb3f8b46d.tar.gz |
Fix some vnode management problems, and better mgmt of vnode free list.
Fix the UIO optimization code.
Fix an assumption in vm_map_insert regarding allocation of swap pagers.
Fix an spl problem in the collapse handling in vm_object_deallocate.
When pages are freed from vnode objects, and the criteria for putting
the associated vnode onto the free list is reached, either put the
vnode onto the list, or put it onto an interrupt safe version of the
list, for further transfer onto the actual free list.
Some minor syntax changes changing pre-decs, pre-incs to post versions.
Remove a bogus timeout (that I added for debugging) from vn_lock.
PHK will likely still have problems with the vnode list management, and
so do I, but it is better than it was.
Diffstat (limited to 'sys/vm/vm_page.c')
-rw-r--r-- | sys/vm/vm_page.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 3b36526..ff824d6 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91 - * $Id: vm_page.c,v 1.83 1997/11/06 08:35:50 dyson Exp $ + * $Id: vm_page.c,v 1.84 1997/12/29 00:24:58 dyson Exp $ */ /* @@ -753,6 +753,7 @@ vm_page_alloc(object, pindex, page_req) { register vm_page_t m; struct vpgqueues *pq; + vm_object_t oldobject; int queue, qtype; int s; @@ -861,9 +862,11 @@ vm_page_alloc(object, pindex, page_req) TAILQ_REMOVE(pq->pl, m, pageq); --(*pq->cnt); --(*pq->lcnt); + oldobject = NULL; if (qtype == PQ_ZERO) { m->flags = PG_ZERO|PG_BUSY; } else if (qtype == PQ_CACHE) { + oldobject = m->object; vm_page_remove(m); m->flags = PG_BUSY; } else { @@ -891,6 +894,19 @@ vm_page_alloc(object, pindex, page_req) (cnt.v_free_count < cnt.v_pageout_free_min)) pagedaemon_wakeup(); + if (((page_req == VM_ALLOC_NORMAL) || (page_req == VM_ALLOC_ZERO)) && + oldobject && + ((oldobject->type == OBJT_VNODE) && + (oldobject->ref_count == 0) && + (oldobject->resident_page_count == 0))) { + struct vnode *vp; + vp = (struct vnode *) oldobject->handle; + if (VSHOULDFREE(vp)) { + vm_object_reference(oldobject); + vm_object_vndeallocate(oldobject); + } + } + return (m); } @@ -954,6 +970,7 @@ static int vm_page_freechk_and_unqueue(m) vm_page_t m; { +#if !defined(MAX_PERF) if (m->busy || (m->flags & PG_BUSY) || ((m->queue - m->pc) == PQ_FREE) || @@ -966,6 +983,7 @@ vm_page_freechk_and_unqueue(m) else panic("vm_page_free: freeing busy page"); } +#endif vm_page_remove(m); vm_page_unqueue_nowakeup(m); |