Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/arch/hppa Pull up following revision(s) (requested by...



details:   https://anonhg.NetBSD.org/src/rev/40d003963f90
branches:  netbsd-9
changeset: 366708:40d003963f90
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Jun 10 17:16:54 2022 +0000

description:
Pull up following revision(s) (requested by skrll in ticket #1467):

        sys/arch/hppa/include/pmap.h: revision 1.41
        sys/arch/hppa/hppa/pmap.c: revision 1.117

port-hppa/56849: Wacko kernel memory accounting in current/hppa

Two fixes:
- Don't include direct mapped memory in pmap statistics
- Decrement pmap statistics counts in pmap_kremove

diffstat:

 sys/arch/hppa/hppa/pmap.c    |  16 +++++++++++-----
 sys/arch/hppa/include/pmap.h |   4 +++-
 2 files changed, 14 insertions(+), 6 deletions(-)

diffs (69 lines):

diff -r dc09027cda75 -r 40d003963f90 sys/arch/hppa/hppa/pmap.c
--- a/sys/arch/hppa/hppa/pmap.c Fri Jun 10 16:28:16 2022 +0000
+++ b/sys/arch/hppa/hppa/pmap.c Fri Jun 10 17:16:54 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.100 2016/12/22 14:47:57 cherry Exp $        */
+/*     $NetBSD: pmap.c,v 1.100.20.1 2022/06/10 17:16:54 martin Exp $   */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.100 2016/12/22 14:47:57 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.100.20.1 2022/06/10 17:16:54 martin Exp $");
 
 #include "opt_cputype.h"
 
@@ -975,7 +975,7 @@
                else if (va == uvm_lwp_getuarea(&lwp0) + USPACE - PAGE_SIZE)
                        prot = UVM_PROT_NONE;
 #endif
-               pmap_kenter_pa(va, va, prot, 0);
+               pmap_kenter_pa(va, va, prot, PMAP_DIRECTMAP);
        }
 
        /* XXXNH update */
@@ -1777,8 +1777,11 @@
            pmap_prot(pmap_kernel(), prot & VM_PROT_ALL));
        if (IS_IOPAGE_P(pa) || (flags & PMAP_NOCACHE))
                pte |= PTE_PROT(TLB_UNCACHEABLE);
-       pmap_kernel()->pm_stats.wired_count++;
-       pmap_kernel()->pm_stats.resident_count++;
+
+       if ((flags & PMAP_DIRECTMAP) == 0) {
+               pmap_kernel()->pm_stats.wired_count++;
+               pmap_kernel()->pm_stats.resident_count++;
+       }
        if (opte)
                pmap_pte_flush(pmap_kernel(), va, opte);
 
@@ -1865,6 +1868,9 @@
                pmap_pte_flush(pmap, va, pte);
                pmap_pte_set(pde, va, 0);
 
+               pmap->pm_stats.wired_count--;
+               pmap->pm_stats.resident_count--;
+
                pg = pmap_initialized ? PHYS_TO_VM_PAGE(PTE_PAGE(pte)) : NULL;
                if (pg != NULL) {
                        pve = pmap_pv_remove(pg, pmap, va);
diff -r dc09027cda75 -r 40d003963f90 sys/arch/hppa/include/pmap.h
--- a/sys/arch/hppa/include/pmap.h      Fri Jun 10 16:28:16 2022 +0000
+++ b/sys/arch/hppa/include/pmap.h      Fri Jun 10 17:16:54 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.h,v 1.37 2013/01/07 16:57:28 chs Exp $    */
+/*     $NetBSD: pmap.h,v 1.37.42.1 2022/06/10 17:16:54 martin Exp $    */
 
 /*     $OpenBSD: pmap.h,v 1.35 2007/12/14 18:32:23 deraadt Exp $       */
 
@@ -72,6 +72,8 @@
 #define        HPPA_MAX_PID    0xfffa
 #define        HPPA_SID_MAX    0x7ffd
 
+#define        PMAP_DIRECTMAP  0x10000000 /* kenter_pa */
+
 /*
  * DON'T CHANGE THIS - this is assumed in lots of places.
  */



Home | Main Index | Thread Index | Old Index