From 95395ca1c1991253b2f0273424ca4a5d720494b7 Mon Sep 17 00:00:00 2001 From: John Dyson Date: Sun, 13 Apr 1997 03:33:25 +0000 Subject: [PATCH] Improve the buffer cache memory policy by moving pages over to the cache queue more often. The pageout daemon had to be waken up more often than necessary since pages were not put on the cache queue, when they should have been. Submitted by: David Greenman --- sys/kern/vfs_bio.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 6eb240426cc7..28d83936c972 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -18,7 +18,7 @@ * 5. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: vfs_bio.c,v 1.112 1997/02/22 09:39:30 peter Exp $ + * $Id: vfs_bio.c,v 1.113 1997/04/01 08:38:53 bde Exp $ */ /* @@ -694,16 +694,19 @@ vfs_vmio_release(bp) /* * If this is an async free -- we cannot place - * pages onto the cache queue, so our policy for - * such buffers is to avoid the cache queue, and - * only modify the active queue or free queue. + * pages onto the cache queue. If it is an + * async free, then we don't modify any queues. + * This is probably in error (for perf reasons), + * and we will eventually need to build + * a more complete infrastructure to support I/O + * rundown. */ if ((bp->b_flags & B_ASYNC) == 0) { /* * In the case of sync buffer frees, we can do pretty much * anything to any of the memory queues. Specifically, - * the cache queue is free to be modified. + * the cache queue is okay to be modified. */ if (m->valid) { if(m->dirty == 0) @@ -711,14 +714,10 @@ vfs_vmio_release(bp) /* * this keeps pressure off of the process memory */ - if ((vm_swap_size == 0) || - (cnt.v_free_count < cnt.v_free_min)) { - if ((m->dirty == 0) && - (m->hold_count == 0)) - vm_page_cache(m); - else - vm_page_deactivate(m); - } + if (m->dirty == 0 && m->hold_count == 0) + vm_page_cache(m); + else + vm_page_deactivate(m); } else if (m->hold_count == 0) { vm_page_protect(m, VM_PROT_NONE); vm_page_free(m);