Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386 Glue in uvm_pageidlezero(). While here, impro...



details:   https://anonhg.NetBSD.org/src/rev/d0d7bc47a0a7
branches:  trunk
changeset: 485315:d0d7bc47a0a7
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Apr 24 17:18:16 2000 +0000

description:
Glue in uvm_pageidlezero().  While here, improve some panic messages
in pmap.c, as requested by Jonathan Stone.

diffstat:

 sys/arch/i386/i386/genassym.cf |   5 ++++-
 sys/arch/i386/i386/locore.s    |   9 ++++++++-
 sys/arch/i386/i386/pmap.c      |  42 +++++++++++++++++++++++++++++++++++-------
 sys/arch/i386/include/pmap.h   |   8 +++++++-
 4 files changed, 54 insertions(+), 10 deletions(-)

diffs (162 lines):

diff -r 278ae71766e2 -r d0d7bc47a0a7 sys/arch/i386/i386/genassym.cf
--- a/sys/arch/i386/i386/genassym.cf    Mon Apr 24 17:12:00 2000 +0000
+++ b/sys/arch/i386/i386/genassym.cf    Mon Apr 24 17:18:16 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: genassym.cf,v 1.17 1999/06/17 00:12:11 thorpej Exp $
+#      $NetBSD: genassym.cf,v 1.18 2000/04/24 17:18:16 thorpej Exp $
 
 #
 # Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -87,6 +87,7 @@
 
 include <vm/vm.h>
 
+include <uvm/uvm.h>
 include <uvm/uvm_extern.h>
 
 include <machine/trap.h>
@@ -127,6 +128,8 @@
 
 define VM_MAXUSER_ADDRESS      (int)VM_MAXUSER_ADDRESS
 
+define UVM_PAGE_IDLE_ZERO      offsetof(struct uvm, page_idle_zero)
+
 define P_ADDR                  offsetof(struct proc, p_addr)
 define P_BACK                  offsetof(struct proc, p_back)
 define P_FORW                  offsetof(struct proc, p_forw)
diff -r 278ae71766e2 -r d0d7bc47a0a7 sys/arch/i386/i386/locore.s
--- a/sys/arch/i386/i386/locore.s       Mon Apr 24 17:12:00 2000 +0000
+++ b/sys/arch/i386/i386/locore.s       Mon Apr 24 17:18:16 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.217 2000/03/22 20:58:27 ws Exp $  */
+/*     $NetBSD: locore.s,v 1.218 2000/04/24 17:18:16 thorpej Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -1839,6 +1839,13 @@
        testl   %ecx,%ecx
        jnz     sw1
        sti
+
+       /* Try to zero some pages. */
+       movl    _C_LABEL(uvm)+UVM_PAGE_IDLE_ZERO,%ecx
+       testl   %ecx,%ecx
+       jz      1f
+       call    _C_LABEL(uvm_pageidlezero)
+1:
 #if NAPM > 0
        call    _C_LABEL(apm_cpu_idle)
 #endif
diff -r 278ae71766e2 -r d0d7bc47a0a7 sys/arch/i386/i386/pmap.c
--- a/sys/arch/i386/i386/pmap.c Mon Apr 24 17:12:00 2000 +0000
+++ b/sys/arch/i386/i386/pmap.c Mon Apr 24 17:18:16 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.88 2000/04/11 06:30:28 matthias Exp $       */
+/*     $NetBSD: pmap.c,v 1.89 2000/04/24 17:18:17 thorpej Exp $        */
 
 /*
  *
@@ -2074,6 +2074,28 @@
 }
 
 /*
+ * pmap_zero_page_uncached: the same, except uncached.
+ */
+
+void
+pmap_zero_page_uncached(pa)
+       paddr_t pa;
+{
+       simple_lock(&pmap_zero_page_lock);
+#ifdef DIAGNOSTIC
+       if (*zero_pte)
+               panic("pmap_zero_page_uncached: lock botch");
+#endif
+
+       *zero_pte = (pa & PG_FRAME) | PG_V | PG_RW |    /* map in */
+           ((cpu_class != CPUCLASS_386) ? PG_N : 0);
+       memset(zerop, 0, NBPG);                         /* zero */
+       *zero_pte = 0;                                  /* zap! */
+       pmap_update_pg((vaddr_t)zerop);                 /* flush TLB */
+       simple_unlock(&pmap_zero_page_lock);
+}
+
+/*
  * pmap_copy_page: copy a page
  */
 
@@ -2180,7 +2202,8 @@
 #ifdef DIAGNOSTIC
                if (bank == -1)
                        panic("pmap_remove_ptes: unmanaged page marked "
-                             "PG_PVLIST");
+                             "PG_PVLIST, va = 0x%lx, pa = 0x%lx",
+                             startva, (u_long)(opte & PG_FRAME));
 #endif
 
                /* sync R/M bits */
@@ -2246,7 +2269,7 @@
        if ((opte & PG_PVLIST) == 0) {
 #ifdef DIAGNOSTIC
                if (vm_physseg_find(i386_btop(opte & PG_FRAME), &off) != -1)
-                       panic("pmap_remove_ptes: managed page without "
+                       panic("pmap_remove_pte: managed page without "
                              "PG_PVLIST for 0x%lx", va);
 #endif
                return(TRUE);
@@ -2255,7 +2278,9 @@
        bank = vm_physseg_find(i386_btop(opte & PG_FRAME), &off);
 #ifdef DIAGNOSTIC
        if (bank == -1)
-               panic("pmap_remove_pte: unmanaged page marked PG_PVLIST");
+               panic("pmap_remove_pte: unmanaged page marked "
+                   "PG_PVLIST, va = 0x%lx, pa = 0x%lx", va,
+                   (u_long)(opte & PG_FRAME));
 #endif
 
        /* sync R/M bits */
@@ -3471,8 +3496,10 @@
                                bank = vm_physseg_find(atop(pa), &off);
 #ifdef DIAGNOSTIC
                                if (bank == -1)
-                                       panic("pmap_enter: PG_PVLIST mapping "
-                                             "with unmanaged page");
+                                       panic("pmap_enter: same pa PG_PVLIST "
+                                             "mapping with unmanaged page "
+                                             "pa = 0x%lx (0x%lx)", pa,
+                                             atop(pa));
 #endif
                                pvh = &vm_physmem[bank].pmseg.pvhead[off];
                                simple_lock(&pvh->pvh_lock);
@@ -3498,7 +3525,8 @@
 #ifdef DIAGNOSTIC
                        if (bank == -1)
                                panic("pmap_enter: PG_PVLIST mapping with "
-                                     "unmanaged page");
+                                     "unmanaged page "
+                                     "pa = 0x%lx (0x%lx)", pa, atop(pa));
 #endif
                        pvh = &vm_physmem[bank].pmseg.pvhead[off];
                        simple_lock(&pvh->pvh_lock);
diff -r 278ae71766e2 -r d0d7bc47a0a7 sys/arch/i386/include/pmap.h
--- a/sys/arch/i386/include/pmap.h      Mon Apr 24 17:12:00 2000 +0000
+++ b/sys/arch/i386/include/pmap.h      Mon Apr 24 17:18:16 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.h,v 1.43 2000/02/11 07:00:13 thorpej Exp $        */
+/*     $NetBSD: pmap.h,v 1.44 2000/04/24 17:18:18 thorpej Exp $        */
 
 /*
  *
@@ -409,6 +409,12 @@
 #define PMAP_GROWKERNEL                /* turn on pmap_growkernel interface */
 
 /*
+ * Do idle page zero'ing uncached to avoid polluting the cache.
+ */
+void           pmap_zero_page_uncached __P((paddr_t));
+#define        PMAP_PAGEIDLEZERO(pa)   pmap_zero_page_uncached((pa))
+
+/*
  * inline functions
  */
 



Home | Main Index | Thread Index | Old Index