From 475dca82bb5b3a340c9d9a4880adc1708ee74ec3 Mon Sep 17 00:00:00 2001 From: John Dyson Date: Fri, 7 Jun 1996 02:36:08 +0000 Subject: [PATCH] Fix a bug in the pmap_object_init_pt routine that pages aren't taken from the cache queue before being mapped into the process. --- sys/amd64/amd64/pmap.c | 4 +++- sys/i386/i386/pmap.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 2b487254dc65..27a523618691 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.99 1996/06/05 03:31:26 dyson Exp $ + * $Id: pmap.c,v 1.100 1996/06/05 06:36:21 dyson Exp $ */ /* @@ -1797,6 +1797,8 @@ pmap_object_init_pt(pmap, addr, object, pindex, size, limit) ((p->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) && (p->busy == 0) && (p->flags & (PG_BUSY | PG_FICTITIOUS)) == 0) { + if (p->queue == PQ_CACHE) + vm_page_deactivate(p); p->flags |= PG_BUSY; pmap_enter_quick(pmap, addr + (tmpidx << PAGE_SHIFT), diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 2b487254dc65..27a523618691 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.99 1996/06/05 03:31:26 dyson Exp $ + * $Id: pmap.c,v 1.100 1996/06/05 06:36:21 dyson Exp $ */ /* @@ -1797,6 +1797,8 @@ pmap_object_init_pt(pmap, addr, object, pindex, size, limit) ((p->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) && (p->busy == 0) && (p->flags & (PG_BUSY | PG_FICTITIOUS)) == 0) { + if (p->queue == PQ_CACHE) + vm_page_deactivate(p); p->flags |= PG_BUSY; pmap_enter_quick(pmap, addr + (tmpidx << PAGE_SHIFT),