Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/alpha/alpha Count new resident and wired pages in p...



details:   https://anonhg.NetBSD.org/src/rev/441022146c76
branches:  trunk
changeset: 473026:441022146c76
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon May 17 16:22:57 1999 +0000

description:
Count new resident and wired pages in pmap_kenter*().

diffstat:

 sys/arch/alpha/alpha/pmap.c |  23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diffs (79 lines):

diff -r e49fa84c9e59 -r 441022146c76 sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c       Mon May 17 16:00:05 1999 +0000
+++ b/sys/arch/alpha/alpha/pmap.c       Mon May 17 16:22:57 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.93 1999/04/15 22:15:38 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.94 1999/05/17 16:22:57 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -155,7 +155,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.93 1999/04/15 22:15:38 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.94 1999/05/17 16:22:57 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -898,6 +898,7 @@
         * references kernel_lev1map, it always has an invalid ASN
         * generation.
         */
+       memset(pmap_kernel(), 0, sizeof(struct pmap));
        pmap_kernel()->pm_lev1map = kernel_lev1map;
        pmap_kernel()->pm_count = 1;
        pmap_kernel()->pm_asn = kernel_pmap_asn_store;
@@ -1828,6 +1829,7 @@
        pt_entry_t *pte, npte;
        long cpu_id = alpha_pal_whami();
        boolean_t needisync = FALSE;
+       int s;
 
 #ifdef DEBUG
        if (pmapdebug & (PDB_FOLLOW|PDB_ENTER))
@@ -1845,6 +1847,20 @@
 
        pte = PMAP_KERNEL_PTE(va);
 
+       /*
+        * Update stats; must lock the kernel pmap to do this.
+        */
+       s = splimp();
+       simple_lock(&pmap->pm_slock);
+
+       if (pmap_pte_v(pte) == 0)
+               pmap_kernel()->pm_stats.resident_count++;
+       if (pmap_pte_w(pte) == 0)
+               pmap_kernel()->pm_stats.wired_count++;
+
+       simple_unlock(&pmap->pm_slock);
+       splx(s);
+
        if ((prot & VM_PROT_EXECUTE) != 0 || pmap_pte_exec(pte))
                needisync = TRUE;
 
@@ -1921,6 +1937,7 @@
        pt_entry_t *pte;
        boolean_t needisync = FALSE;
        long cpu_id = alpha_pal_whami();
+       int s;
 
 #ifdef DEBUG
        if (pmapdebug & (PDB_FOLLOW|PDB_ENTER))
@@ -1933,6 +1950,7 @@
                panic("pmap_kremove: user address");
 #endif
 
+       s = splimp();
        PMAP_MAP_TO_HEAD_LOCK();
        simple_lock(&pmap_kernel()->pm_slock);
 
@@ -1948,6 +1966,7 @@
 
        simple_unlock(&pmap_kernel()->pm_slock);
        PMAP_MAP_TO_HEAD_UNLOCK();
+       splx(s);
 }
 
 /*



Home | Main Index | Thread Index | Old Index