Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/aarch64/aarch64 don't call pool_cache_put with lock...



details:   https://anonhg.NetBSD.org/src/rev/59111adc9e08
branches:  trunk
changeset: 834028:59111adc9e08
user:      ryo <ryo%NetBSD.org@localhost>
date:      Tue Jul 24 10:08:43 2018 +0000

description:
don't call pool_cache_put with locking pmap. pool_cache_put call pmap_kenter_pa internally.
(pool_cache_put_paddr -> pool_cache_put_slow -> pool_get -> pmap_kenter_pa)

diffstat:

 sys/arch/aarch64/aarch64/pmap.c |  22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diffs (92 lines):

diff -r 34a278cd3e7a -r 59111adc9e08 sys/arch/aarch64/aarch64/pmap.c
--- a/sys/arch/aarch64/aarch64/pmap.c   Tue Jul 24 10:05:36 2018 +0000
+++ b/sys/arch/aarch64/aarch64/pmap.c   Tue Jul 24 10:08:43 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.13 2018/07/23 22:51:39 ryo Exp $    */
+/*     $NetBSD: pmap.c,v 1.14 2018/07/24 10:08:43 ryo Exp $    */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.13 2018/07/23 22:51:39 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.14 2018/07/24 10:08:43 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -852,7 +852,7 @@
        return pte;
 }
 
-static void
+static struct pv_entry *
 _pmap_remove_pv(struct vm_page *pg, struct pmap *pm, vaddr_t va, pt_entry_t pte)
 {
        struct vm_page_md *md;
@@ -883,8 +883,7 @@
 
        pmap_pv_unlock(md);
 
-       if (pv != NULL)
-               pool_cache_put(&_pmap_pv_pool, pv);
+       return pv;
 }
 
 #if defined(PMAP_PV_DEBUG) || defined(DDB)
@@ -1292,7 +1291,7 @@
     u_int flags, bool kenter)
 {
        struct vm_page *pg;
-       struct pv_entry *spv;
+       struct pv_entry *spv, *opv = NULL;
        pd_entry_t pde;
        pt_entry_t attr, pte, *ptep;
 #ifdef UVMHIST
@@ -1428,7 +1427,7 @@
 
                        opg = PHYS_TO_VM_PAGE(l3pte_pa(pte));
                        if (opg != NULL)
-                               _pmap_remove_pv(opg, pm, va, pte);
+                               opv = _pmap_remove_pv(opg, pm, va, pte);
                }
 
                if (pte & LX_BLKPAG_OS_WIRED)
@@ -1509,6 +1508,9 @@
        if (spv != NULL)
                pool_cache_put(&_pmap_pv_pool, spv);
 
+       if (opv != NULL)
+               pool_cache_put(&_pmap_pv_pool, opv);
+
        return error;
 }
 
@@ -1531,6 +1533,7 @@
 {
        pt_entry_t pte, *ptep;
        struct vm_page *pg;
+       struct pv_entry *opv = NULL;
        paddr_t pa;
 
 
@@ -1556,7 +1559,7 @@
                        pg = PHYS_TO_VM_PAGE(pa);
 
                if (pg != NULL)
-                       _pmap_remove_pv(pg, pm, va, pte);
+                       opv = _pmap_remove_pv(pg, pm, va, pte);
 
                atomic_swap_64(ptep, 0);
 #if 0
@@ -1571,6 +1574,9 @@
        }
  done:
        pm_unlock(pm);
+
+       if (opv != NULL)
+               pool_cache_put(&_pmap_pv_pool, opv);
 }
 
 void



Home | Main Index | Thread Index | Old Index