Fix a bug in pmap_collect_pv(), even though nobody currently uses it:

When we put a page on the collection list, we must subtract NPVPPG from the
total free count: one for each pv_entry that's free in that page, and one for
each free pv_entry in other pages that we're going to eat by moving the ones
in the page being collected.
This commit is contained in:
mycroft 1999-03-27 05:57:02 +00:00
parent f4647f0ec7
commit 93768384ee
9 changed files with 50 additions and 34 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.62 1999/03/27 03:37:51 mycroft Exp $ */
/* $NetBSD: pmap.c,v 1.63 1999/03/27 05:57:02 mycroft Exp $ */
/*
* Copyright (c) 1991 Regents of the University of California.
@ -737,8 +737,9 @@ pmap_collect_pv()
npvp = pvp->pvp_pgi.pgi_list.tqe_next;
if (pvp->pvp_pgi.pgi_nfree > NPVPPG / 3) {
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp, pvp_pgi.pgi_list);
pv_nfree -= pvp->pvp_pgi.pgi_nfree;
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp,
pvp_pgi.pgi_list);
pv_nfree -= NPVPPG;
pvp->pvp_pgi.pgi_nfree = -1;
}
}
@ -755,7 +756,8 @@ pmap_collect_pv()
if (pvp->pvp_pgi.pgi_nfree == -1) {
pvp = pv_page_freelist.tqh_first;
if (--pvp->pvp_pgi.pgi_nfree == 0) {
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_REMOVE(&pv_page_freelist, pvp,
pvp_pgi.pgi_list);
}
npv = pvp->pvp_pgi.pgi_freelist;
#ifdef DIAGNOSTIC

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.50 1999/03/27 05:12:21 mycroft Exp $ */
/* $NetBSD: pmap.c,v 1.51 1999/03/27 05:57:03 mycroft Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@ -338,7 +338,7 @@ pmap_collect_pv()
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp,
pvp_pgi.pgi_list);
pv_nfree -= pvp->pvp_pgi.pgi_nfree;
pv_nfree -= NPVPPG;
pvp->pvp_pgi.pgi_nfree = -1;
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.69 1999/03/27 03:37:52 mycroft Exp $ */
/* $NetBSD: pmap.c,v 1.70 1999/03/27 05:57:03 mycroft Exp $ */
/*
* Copyright (c) 1991, 1993
@ -607,8 +607,9 @@ pmap_collect_pv()
npvp = pvp->pvp_pgi.pgi_list.tqe_next;
if (pvp->pvp_pgi.pgi_nfree > NPVPPG / 3) {
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp, pvp_pgi.pgi_list);
pv_nfree -= pvp->pvp_pgi.pgi_nfree;
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp,
pvp_pgi.pgi_list);
pv_nfree -= NPVPPG;
pvp->pvp_pgi.pgi_nfree = -1;
}
}
@ -625,7 +626,8 @@ pmap_collect_pv()
if (pvp->pvp_pgi.pgi_nfree == -1) {
pvp = pv_page_freelist.tqh_first;
if (--pvp->pvp_pgi.pgi_nfree == 0) {
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_REMOVE(&pv_page_freelist, pvp,
pvp_pgi.pgi_list);
}
npv = pvp->pvp_pgi.pgi_freelist;
#ifdef DIAGNOSTIC

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.67 1999/03/26 23:41:30 mycroft Exp $ */
/* $NetBSD: pmap.c,v 1.68 1999/03/27 05:57:04 mycroft Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -503,8 +503,9 @@ pmap_collect_pv()
npvp = pvp->pvp_pgi.pgi_list.tqe_next;
if (pvp->pvp_pgi.pgi_nfree > NPVPPG / 3) {
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp, pvp_pgi.pgi_list);
pv_nfree -= pvp->pvp_pgi.pgi_nfree;
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp,
pvp_pgi.pgi_list);
pv_nfree -= NPVPPG;
pvp->pvp_pgi.pgi_nfree = -1;
}
}
@ -521,7 +522,8 @@ pmap_collect_pv()
if (pvp->pvp_pgi.pgi_nfree == -1) {
pvp = pv_page_freelist.tqh_first;
if (--pvp->pvp_pgi.pgi_nfree == 0) {
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_REMOVE(&pv_page_freelist, pvp,
pvp_pgi.pgi_list);
}
npv = pvp->pvp_pgi.pgi_freelist;
#ifdef DIAGNOSTIC

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.51 1999/03/27 03:37:52 mycroft Exp $ */
/* $NetBSD: pmap.c,v 1.52 1999/03/27 05:57:04 mycroft Exp $ */
/*
* Copyright (c) 1991, 1993
@ -625,8 +625,9 @@ pmap_collect_pv()
npvp = pvp->pvp_pgi.pgi_list.tqe_next;
if (pvp->pvp_pgi.pgi_nfree > NPVPPG / 3) {
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp, pvp_pgi.pgi_list);
pv_nfree -= pvp->pvp_pgi.pgi_nfree;
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp,
pvp_pgi.pgi_list);
pv_nfree -= NPVPPG;
pvp->pvp_pgi.pgi_nfree = -1;
}
}
@ -643,7 +644,8 @@ pmap_collect_pv()
if (pvp->pvp_pgi.pgi_nfree == -1) {
pvp = pv_page_freelist.tqh_first;
if (--pvp->pvp_pgi.pgi_nfree == 0) {
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_REMOVE(&pv_page_freelist, pvp,
pvp_pgi.pgi_list);
}
npv = pvp->pvp_pgi.pgi_freelist;
#ifdef DIAGNOSTIC

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.29 1999/03/27 03:37:52 mycroft Exp $ */
/* $NetBSD: pmap.c,v 1.30 1999/03/27 05:57:04 mycroft Exp $ */
/*
* Copyright (c) 1991, 1993
@ -586,8 +586,9 @@ pmap_collect_pv()
npvp = pvp->pvp_pgi.pgi_list.tqe_next;
if (pvp->pvp_pgi.pgi_nfree > NPVPPG / 3) {
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp, pvp_pgi.pgi_list);
pv_nfree -= pvp->pvp_pgi.pgi_nfree;
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp,
pvp_pgi.pgi_list);
pv_nfree -= NPVPPG;
pvp->pvp_pgi.pgi_nfree = -1;
}
}
@ -604,7 +605,8 @@ pmap_collect_pv()
if (pvp->pvp_pgi.pgi_nfree == -1) {
pvp = pv_page_freelist.tqh_first;
if (--pvp->pvp_pgi.pgi_nfree == 0) {
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_REMOVE(&pv_page_freelist, pvp,
pvp_pgi.pgi_list);
}
npv = pvp->pvp_pgi.pgi_freelist;
#ifdef DIAGNOSTIC

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.11 1999/03/27 03:34:08 mycroft Exp $ */
/* $NetBSD: pmap.c,v 1.12 1999/03/27 05:57:05 mycroft Exp $ */
/*
* This file was taken from mvme68k/mvme68k/pmap.c
@ -624,8 +624,9 @@ pmap_collect_pv()
npvp = pvp->pvp_pgi.pgi_list.tqe_next;
if (pvp->pvp_pgi.pgi_nfree > NPVPPG / 3) {
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp, pvp_pgi.pgi_list);
pv_nfree -= pvp->pvp_pgi.pgi_nfree;
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp,
pvp_pgi.pgi_list);
pv_nfree -= NPVPPG;
pvp->pvp_pgi.pgi_nfree = -1;
}
}
@ -642,7 +643,8 @@ pmap_collect_pv()
if (pvp->pvp_pgi.pgi_nfree == -1) {
pvp = pv_page_freelist.tqh_first;
if (--pvp->pvp_pgi.pgi_nfree == 0) {
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_REMOVE(&pv_page_freelist, pvp,
pvp_pgi.pgi_list);
}
npv = pvp->pvp_pgi.pgi_freelist;
#ifdef DIAGNOSTIC

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.33 1999/03/26 23:41:33 mycroft Exp $ */
/* $NetBSD: pmap.c,v 1.34 1999/03/27 05:57:05 mycroft Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -451,8 +451,9 @@ pmap_collect_pv()
npvp = pvp->pvp_pgi.pgi_list.tqe_next;
if (pvp->pvp_pgi.pgi_nfree > NPVPPG / 3) {
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp, pvp_pgi.pgi_list);
pv_nfree -= pvp->pvp_pgi.pgi_nfree;
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp,
pvp_pgi.pgi_list);
pv_nfree -= NPVPPG;
pvp->pvp_pgi.pgi_nfree = -1;
}
}
@ -469,7 +470,8 @@ pmap_collect_pv()
if (pvp->pvp_pgi.pgi_nfree == -1) {
pvp = pv_page_freelist.tqh_first;
if (--pvp->pvp_pgi.pgi_nfree == 0) {
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_REMOVE(&pv_page_freelist, pvp,
pvp_pgi.pgi_list);
}
npv = pvp->pvp_pgi.pgi_freelist;
#ifdef DIAGNOSTIC

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.30 1999/03/27 03:37:53 mycroft Exp $ */
/* $NetBSD: pmap.c,v 1.31 1999/03/27 05:57:06 mycroft Exp $ */
/*
* Copyright (c) 1991, 1993
@ -604,8 +604,9 @@ pmap_collect_pv()
npvp = pvp->pvp_pgi.pgi_list.tqe_next;
if (pvp->pvp_pgi.pgi_nfree > NPVPPG / 3) {
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp, pvp_pgi.pgi_list);
pv_nfree -= pvp->pvp_pgi.pgi_nfree;
TAILQ_INSERT_TAIL(&pv_page_collectlist, pvp,
pvp_pgi.pgi_list);
pv_nfree -= NPVPPG;
pvp->pvp_pgi.pgi_nfree = -1;
}
}
@ -622,7 +623,8 @@ pmap_collect_pv()
if (pvp->pvp_pgi.pgi_nfree == -1) {
pvp = pv_page_freelist.tqh_first;
if (--pvp->pvp_pgi.pgi_nfree == 0) {
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
TAILQ_REMOVE(&pv_page_freelist, pvp,
pvp_pgi.pgi_list);
}
npv = pvp->pvp_pgi.pgi_freelist;
#ifdef DIAGNOSTIC