From d0686727c032ebf1dab91f097a36668b4f289f96 Mon Sep 17 00:00:00 2001 From: David Greenman Date: Mon, 20 Feb 1995 14:00:50 +0000 Subject: [PATCH] Don't allow act_count to exceed ACT_MAX when bumping it up. Small optimization to vm_page_bits(). Submitted by: John Dyson --- sys/vm/vm_page.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index e0a047acae88..9218fefd8a31 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.18 1995/02/02 09:09:05 davidg Exp $ + * $Id: vm_page.c,v 1.19 1995/02/20 13:58:14 davidg Exp $ */ /* @@ -1002,7 +1002,7 @@ vm_page_activate(m) TAILQ_INSERT_TAIL(&m->object->memq, m, listq); if (m->act_count < 5) m->act_count = 5; - else + else if( m->act_count < ACT_MAX) m->act_count += 1; cnt.v_active_count++; } @@ -1055,6 +1055,8 @@ vm_page_bits(int base, int size) { u_short chunk; + if( (base == 0) && (size == PAGE_SIZE)) + return VM_PAGE_BITS_ALL; size = (size + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1); base = (base % PAGE_SIZE) / DEV_BSIZE; chunk = vm_page_dev_bsize_chunks[size / DEV_BSIZE];