Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86 PR/49691: KAMADA Ken'ichi: free deferred ptp ma...



details:   https://anonhg.NetBSD.org/src/rev/8a7b68a3ae54
branches:  trunk
changeset: 348795:8a7b68a3ae54
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Nov 08 03:05:36 2016 +0000

description:
PR/49691: KAMADA Ken'ichi: free deferred ptp mappings if present.
XXX: pullup-7

diffstat:

 sys/arch/x86/include/pmap.h   |   3 ++-
 sys/arch/x86/x86/pmap.c       |   6 +++---
 sys/arch/x86/x86/vm_machdep.c |  10 ++++++++--
 3 files changed, 13 insertions(+), 6 deletions(-)

diffs (75 lines):

diff -r 20ab06156dc8 -r 8a7b68a3ae54 sys/arch/x86/include/pmap.h
--- a/sys/arch/x86/include/pmap.h       Tue Nov 08 02:43:29 2016 +0000
+++ b/sys/arch/x86/include/pmap.h       Tue Nov 08 03:05:36 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.h,v 1.60 2016/09/19 20:46:55 maya Exp $   */
+/*     $NetBSD: pmap.h,v 1.61 2016/11/08 03:05:36 christos Exp $       */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -482,6 +482,7 @@
 int    pmap_enter_ma(struct pmap *, vaddr_t, paddr_t, paddr_t,
            vm_prot_t, u_int, int);
 bool   pmap_extract_ma(pmap_t, vaddr_t, paddr_t *);
+void   pmap_free_ptps(struct vm_page *);
 
 /*
  * Hooks for the pool allocator.
diff -r 20ab06156dc8 -r 8a7b68a3ae54 sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c   Tue Nov 08 02:43:29 2016 +0000
+++ b/sys/arch/x86/x86/pmap.c   Tue Nov 08 03:05:36 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.222 2016/09/24 21:13:44 dholland Exp $      */
+/*     $NetBSD: pmap.c,v 1.223 2016/11/08 03:05:36 christos Exp $      */
 
 /*-
  * Copyright (c) 2008, 2010, 2016 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.222 2016/09/24 21:13:44 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.223 2016/11/08 03:05:36 christos Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -2277,7 +2277,7 @@
  * pmap_free_ptps: put a list of ptps back to the freelist.
  */
 
-static void
+void
 pmap_free_ptps(struct vm_page *empty_ptps)
 {
        struct vm_page *ptp;
diff -r 20ab06156dc8 -r 8a7b68a3ae54 sys/arch/x86/x86/vm_machdep.c
--- a/sys/arch/x86/x86/vm_machdep.c     Tue Nov 08 02:43:29 2016 +0000
+++ b/sys/arch/x86/x86/vm_machdep.c     Tue Nov 08 03:05:36 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.25 2014/03/11 20:55:19 para Exp $     */
+/*     $NetBSD: vm_machdep.c,v 1.26 2016/11/08 03:05:36 christos Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.25 2014/03/11 20:55:19 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.26 2016/11/08 03:05:36 christos Exp $");
 
 #include "opt_mtrr.h"
 
@@ -249,6 +249,12 @@
        if (proc && l->l_proc->p_md.md_flags & MDP_USEDMTRR)
                mtrr_clean(l->l_proc);
 #endif
+       /*
+        * Free deferred mappings if any.
+        */
+       struct vm_page *empty_ptps = l->l_md.md_gc_ptp;
+       l->l_md.md_gc_ptp = NULL;
+       pmap_free_ptps(empty_ptps);
 }
 
 /*



Home | Main Index | Thread Index | Old Index