Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/alpha Defer sending shootdown IPIs a bit longer. R...



details:   https://anonhg.NetBSD.org/src/rev/e0d44dc99c0a
branches:  trunk
changeset: 512747:e0d44dc99c0a
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Jul 15 21:57:01 2001 +0000

description:
Defer sending shootdown IPIs a bit longer.  Reduces traffic a fair
bit more.

diffstat:

 sys/arch/alpha/alpha/pmap.c       |  36 +++++++++++++++++++++++++++++++++---
 sys/arch/alpha/alpha/vm_machdep.c |   7 +++++--
 sys/arch/alpha/include/pmap.h     |  12 +++++++++---
 3 files changed, 47 insertions(+), 8 deletions(-)

diffs (227 lines):

diff -r 44ee26c8ba54 -r e0d44dc99c0a sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c       Sun Jul 15 21:17:29 2001 +0000
+++ b/sys/arch/alpha/alpha/pmap.c       Sun Jul 15 21:57:01 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.182 2001/07/15 16:42:18 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.183 2001/07/15 21:57:01 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -154,7 +154,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.182 2001/07/15 16:42:18 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.183 2001/07/15 21:57:01 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1543,6 +1543,7 @@
        boolean_t hadasm;
        vaddr_t l1eva, l2eva;
        long cpu_id = cpu_number();
+       PMAP_TLB_SHOOTDOWN_CPUSET_DECL
 
 #ifdef DEBUG
        if (pmapdebug & (PDB_FOLLOW|PDB_PROTECT))
@@ -1596,6 +1597,8 @@
                }
        }
 
+       PMAP_TLB_SHOOTNOW();
+
        if (prot & VM_PROT_EXECUTE)
                PMAP_SYNC_ISTREAM(pmap);
 
@@ -1630,6 +1633,7 @@
        boolean_t wired;
        long cpu_id = cpu_number();
        int error = 0;
+       PMAP_TLB_SHOOTDOWN_CPUSET_DECL
 
 #ifdef DEBUG
        if (pmapdebug & (PDB_FOLLOW|PDB_ENTER))
@@ -1923,6 +1927,7 @@
        if (tflush) {
                PMAP_INVALIDATE_TLB(pmap, va, hadasm, isactive, cpu_id);
                PMAP_TLB_SHOOTDOWN(pmap, va, hadasm ? PG_ASM : 0);
+               PMAP_TLB_SHOOTNOW();
        }
        if (setisync)
                PMAP_SET_NEEDISYNC(pmap);
@@ -1951,6 +1956,7 @@
        long cpu_id = cpu_number();
        boolean_t needisync = FALSE;
        pmap_t pmap = pmap_kernel();
+       PMAP_TLB_SHOOTDOWN_CPUSET_DECL
 
 #ifdef DEBUG
        if (pmapdebug & (PDB_FOLLOW|PDB_ENTER))
@@ -1996,6 +2002,7 @@
         */
        PMAP_INVALIDATE_TLB(pmap, va, TRUE, TRUE, cpu_id);
        PMAP_TLB_SHOOTDOWN(pmap, va, PG_ASM);
+       PMAP_TLB_SHOOTNOW();
 
        if (needisync)
                PMAP_SYNC_ISTREAM_KERNEL();
@@ -2014,6 +2021,7 @@
        boolean_t needisync = FALSE;
        long cpu_id = cpu_number();
        pmap_t pmap = pmap_kernel();
+       PMAP_TLB_SHOOTDOWN_CPUSET_DECL
 
 #ifdef DEBUG
        if (pmapdebug & (PDB_FOLLOW|PDB_ENTER))
@@ -2051,6 +2059,8 @@
                }
        }
 
+       PMAP_TLB_SHOOTNOW();
+
        if (needisync)
                PMAP_SYNC_ISTREAM_KERNEL();
 }
@@ -2574,6 +2584,7 @@
        boolean_t hadasm;
        boolean_t isactive;
        boolean_t needisync = FALSE;
+       PMAP_TLB_SHOOTDOWN_CPUSET_DECL
 
 #ifdef DEBUG
        if (pmapdebug & (PDB_FOLLOW|PDB_REMOVE|PDB_PROTECT))
@@ -2628,6 +2639,7 @@
 
        PMAP_INVALIDATE_TLB(pmap, va, hadasm, isactive, cpu_id);
        PMAP_TLB_SHOOTDOWN(pmap, va, hadasm ? PG_ASM : 0);
+       PMAP_TLB_SHOOTNOW();
 
        /*
         * If we're removing a user mapping, check to see if we
@@ -2679,6 +2691,7 @@
        vaddr_t va;
        boolean_t hadasm, isactive;
        boolean_t needisync, needkisync = FALSE;
+       PMAP_TLB_SHOOTDOWN_CPUSET_DECL
 
 #ifdef DEBUG
        if (pmapdebug & PDB_BITS)
@@ -2735,6 +2748,8 @@
                PMAP_UNLOCK(pv->pv_pmap);
        }
 
+       PMAP_TLB_SHOOTNOW();
+
        if (needkisync)
                PMAP_SYNC_ISTREAM_KERNEL();
 }
@@ -3477,6 +3492,7 @@
 pmap_l3pt_delref(pmap_t pmap, vaddr_t va, pt_entry_t *l3pte, long cpu_id)
 {
        pt_entry_t *l1pte, *l2pte;
+       PMAP_TLB_SHOOTDOWN_CPUSET_DECL
 
        l1pte = pmap_l1pte(pmap, va);
        l2pte = pmap_l2pte(pmap, va, l1pte);
@@ -3510,6 +3526,7 @@
                    PMAP_ISACTIVE(pmap, cpu_id), cpu_id);
                PMAP_TLB_SHOOTDOWN(pmap,
                    (vaddr_t)(&VPT[VPT_INDEX(va)]), 0);
+               PMAP_TLB_SHOOTNOW();
 
                /*
                 * We've freed a level 3 table, so delete the reference
@@ -3747,7 +3764,7 @@
  *     NOTE: The pmap must be locked here.
  */
 void
-pmap_tlb_shootdown(pmap_t pmap, vaddr_t va, pt_entry_t pte)
+pmap_tlb_shootdown(pmap_t pmap, vaddr_t va, pt_entry_t pte, u_long *cpumaskp)
 {
        struct pmap_tlb_shootdown_q *pq;
        struct pmap_tlb_shootdown_job *pj;
@@ -3821,6 +3838,19 @@
                PSJQ_UNLOCK(pq, s);
        }
 
+       *cpumaskp |= cpumask;
+}
+
+/*
+ * pmap_tlb_shootnow:
+ *
+ *     Process the TLB shootdowns that we have been accumulating
+ *     for the specified processor set.
+ */
+void
+pmap_tlb_shootnow(u_long cpumask)
+{
+
        alpha_multicast_ipi(cpumask, ALPHA_IPI_SHOOTDOWN);
 }
 
diff -r 44ee26c8ba54 -r e0d44dc99c0a sys/arch/alpha/alpha/vm_machdep.c
--- a/sys/arch/alpha/alpha/vm_machdep.c Sun Jul 15 21:17:29 2001 +0000
+++ b/sys/arch/alpha/alpha/vm_machdep.c Sun Jul 15 21:57:01 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.70 2001/07/12 23:35:43 thorpej Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.71 2001/07/15 21:57:01 thorpej Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.70 2001/07/12 23:35:43 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.71 2001/07/15 21:57:01 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -265,6 +265,7 @@
 {
        long fidx, tidx;
        ssize_t todo;
+       PMAP_TLB_SHOOTDOWN_CPUSET_DECL
 
        if (size % NBPG)
                panic("pagemove");
@@ -287,6 +288,8 @@
                from += NBPG;
                to += NBPG;
        }
+
+       PMAP_TLB_SHOOTNOW();
 }
 
 /*
diff -r 44ee26c8ba54 -r e0d44dc99c0a sys/arch/alpha/include/pmap.h
--- a/sys/arch/alpha/include/pmap.h     Sun Jul 15 21:17:29 2001 +0000
+++ b/sys/arch/alpha/include/pmap.h     Sun Jul 15 21:57:01 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.52 2001/07/15 16:42:19 thorpej Exp $ */
+/* $NetBSD: pmap.h,v 1.53 2001/07/15 21:57:02 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -180,12 +180,18 @@
 
 void   pmap_do_reactivate(struct cpu_info *, struct trapframe *);
 
-void   pmap_tlb_shootdown(pmap_t, vaddr_t, pt_entry_t);
+void   pmap_tlb_shootdown(pmap_t, vaddr_t, pt_entry_t, u_long *);
+void   pmap_tlb_shootnow(u_long);
 void   pmap_do_tlb_shootdown(struct cpu_info *, struct trapframe *);
+#define        PMAP_TLB_SHOOTDOWN_CPUSET_DECL          u_long shootset = 0;
 #define        PMAP_TLB_SHOOTDOWN(pm, va, pte)                                 \
-       pmap_tlb_shootdown((pm), (va), (pte))
+       pmap_tlb_shootdown((pm), (va), (pte), &shootset)
+#define        PMAP_TLB_SHOOTNOW()                                             \
+       pmap_tlb_shootnow(shootset)
 #else
+#define        PMAP_TLB_SHOOTDOWN_CPUSET_DECL          /* nothing */
 #define        PMAP_TLB_SHOOTDOWN(pm, va, pte)         /* nothing */
+#define        PMAP_TLB_SHOOTNOW()                     /* nothing */
 #endif /* MULTIPROCESSOR */
 #endif /* _LKM */
 



Home | Main Index | Thread Index | Old Index