Source-Changes-HG archive

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

[src/trunk]: src/sys/arch in pmap_pageable(), rather than marking a PT page a...



details:   https://anonhg.NetBSD.org/src/rev/ff19233501a0
branches:  trunk
changeset: 472128:ff19233501a0
user:      chs <chs%NetBSD.org@localhost>
date:      Thu Apr 22 04:24:52 1999 +0000

description:
in pmap_pageable(), rather than marking a PT page as not modified
to trick the pagedaemon into freeing it later, just unmap the page
and free it immediately.  fixes PR 7337.

diffstat:

 sys/arch/amiga/amiga/pmap.c     |  11 +++++------
 sys/arch/atari/atari/pmap.c     |  11 +++++------
 sys/arch/hp300/hp300/pmap.c     |  17 ++++++-----------
 sys/arch/mac68k/mac68k/pmap.c   |  17 ++++++-----------
 sys/arch/mvme68k/mvme68k/pmap.c |  17 ++++++-----------
 sys/arch/next68k/next68k/pmap.c |  17 ++++++-----------
 sys/arch/x68k/x68k/pmap.c       |  17 ++++++-----------
 7 files changed, 40 insertions(+), 67 deletions(-)

diffs (233 lines):

diff -r 7c16fb65e1f2 -r ff19233501a0 sys/arch/amiga/amiga/pmap.c
--- a/sys/arch/amiga/amiga/pmap.c       Thu Apr 22 04:20:53 1999 +0000
+++ b/sys/arch/amiga/amiga/pmap.c       Thu Apr 22 04:24:52 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.63 1999/03/27 05:57:02 mycroft Exp $        */
+/*     $NetBSD: pmap.c,v 1.64 1999/04/22 04:24:52 chs Exp $    */
 
 /* 
  * Copyright (c) 1991 Regents of the University of California.
@@ -2058,15 +2058,14 @@
                }
 #endif
                /*
-                * Mark it unmodified to avoid pageout
+                * page is unused, free it now!
                 */
-               pmap_changebit(pa, PG_M, FALSE);
+               pmap_remove(pv->pv_pmap, pv->pv_va, pv->pv_va + NBPG);
+               uvm_pagefree(PHYS_TO_VM_PAGE(pa));
 #ifdef DEBUG
                if (pmapdebug & PDB_PTPAGE)
-                       printf("pmap_pageable: PT page %lx(%x) unmodified\n",
+                       printf("pmap_pageable: PT page %lx(%x) freed\n",
                               sva, *(int *)pmap_pte(pmap, sva));
-               if (pmapdebug & PDB_WIRING)
-                       pmap_check_wiring("pageable", sva);
 #endif
        }
 }
diff -r 7c16fb65e1f2 -r ff19233501a0 sys/arch/atari/atari/pmap.c
--- a/sys/arch/atari/atari/pmap.c       Thu Apr 22 04:20:53 1999 +0000
+++ b/sys/arch/atari/atari/pmap.c       Thu Apr 22 04:24:52 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.43 1999/03/27 03:37:51 mycroft Exp $        */
+/*     $NetBSD: pmap.c,v 1.44 1999/04/22 04:24:52 chs Exp $    */
 
 /* 
  * Copyright (c) 1991 Regents of the University of California.
@@ -1946,15 +1946,14 @@
                }
 #endif
                /*
-                * Mark it unmodified to avoid pageout
+                * page is unused, free it now!
                 */
-               pmap_changebit(pa, PG_M, FALSE);
+               pmap_remove(pv->pv_pmap, pv->pv_va, pv->pv_va + NBPG);
+               uvm_pagefree(PHYS_TO_VM_PAGE(pa));
 #ifdef DEBUG
                if (pmapdebug & PDB_PTPAGE)
-                       printf("pmap_pageable: PT page %lx(%x) unmodified\n",
+                       printf("pmap_pageable: PT page %lx(%x) freed\n",
                               sva, *(int *)pmap_pte(pmap, sva));
-               if (pmapdebug & PDB_WIRING)
-                       pmap_check_wiring("pageable", sva);
 #endif
        }
 }
diff -r 7c16fb65e1f2 -r ff19233501a0 sys/arch/hp300/hp300/pmap.c
--- a/sys/arch/hp300/hp300/pmap.c       Thu Apr 22 04:20:53 1999 +0000
+++ b/sys/arch/hp300/hp300/pmap.c       Thu Apr 22 04:24:52 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.72 1999/04/01 20:50:52 drochner Exp $       */
+/*     $NetBSD: pmap.c,v 1.73 1999/04/22 04:24:53 chs Exp $    */
 
 /* 
  * Copyright (c) 1991, 1993
@@ -1848,20 +1848,15 @@
                }
 #endif
                /*
-                * Mark it unmodified to avoid pageout
+                * page is unused, free it now!
                 */
-               pmap_changebit(pa, 0, ~PG_M);
+               pmap_remove_mapping(pv->pv_pmap, pv->pv_va,
+                                   NULL, PRM_TFLUSH|PRM_CFLUSH);
+               uvm_pagefree(PHYS_TO_VM_PAGE(pa));
 #ifdef DEBUG
-               if ((PHYS_TO_VM_PAGE(pa)->flags & PG_CLEAN) == 0) {
-                       printf("pa %lx: flags=%x: not clean\n",
-                              pa, PHYS_TO_VM_PAGE(pa)->flags);
-                       PHYS_TO_VM_PAGE(pa)->flags |= PG_CLEAN;
-               }
                if (pmapdebug & PDB_PTPAGE)
-                       printf("pmap_pageable: PT page %lx(%x) unmodified\n",
+                       printf("pmap_pageable: PT page %lx(%x) freed\n",
                               sva, *pmap_pte(pmap, sva));
-               if (pmapdebug & PDB_WIRING)
-                       pmap_check_wiring("pageable", sva);
 #endif
        }
 }
diff -r 7c16fb65e1f2 -r ff19233501a0 sys/arch/mac68k/mac68k/pmap.c
--- a/sys/arch/mac68k/mac68k/pmap.c     Thu Apr 22 04:20:53 1999 +0000
+++ b/sys/arch/mac68k/mac68k/pmap.c     Thu Apr 22 04:24:52 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.54 1999/04/07 05:59:14 scottr Exp $ */
+/*     $NetBSD: pmap.c,v 1.55 1999/04/22 04:24:53 chs Exp $    */
 
 /*
  * Copyright (c) 1991, 1993
@@ -1701,20 +1701,15 @@
                }
 #endif
                /*
-                * Mark it unmodified to avoid pageout
+                * page is unused, free it now!
                 */
-               pmap_changebit(pa, 0, ~PG_M);
+               pmap_remove_mapping(pv->pv_pmap, pv->pv_va,
+                                   NULL, PRM_TFLUSH|PRM_CFLUSH);
+               uvm_pagefree(PHYS_TO_VM_PAGE(pa));
 #ifdef DEBUG
-               if ((PHYS_TO_VM_PAGE(pa)->flags & PG_CLEAN) == 0) {
-                       printf("pa %lx: flags=%x: not clean\n",
-                              pa, PHYS_TO_VM_PAGE(pa)->flags);
-                       PHYS_TO_VM_PAGE(pa)->flags |= PG_CLEAN;
-               }
                if (pmapdebug & PDB_PTPAGE)
-                       printf("pmap_pageable: PT page %lx(%x) unmodified\n",
+                       printf("pmap_pageable: PT page %lx(%x) freed\n",
                               sva, *pmap_pte(pmap, sva));
-               if (pmapdebug & PDB_WIRING)
-                       pmap_check_wiring("pageable", sva);
 #endif
        }
 }
diff -r 7c16fb65e1f2 -r ff19233501a0 sys/arch/mvme68k/mvme68k/pmap.c
--- a/sys/arch/mvme68k/mvme68k/pmap.c   Thu Apr 22 04:20:53 1999 +0000
+++ b/sys/arch/mvme68k/mvme68k/pmap.c   Thu Apr 22 04:24:52 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.31 1999/04/03 13:15:16 scw Exp $        */
+/*     $NetBSD: pmap.c,v 1.32 1999/04/22 04:24:53 chs Exp $        */
 
 /* 
  * Copyright (c) 1991, 1993
@@ -1685,20 +1685,15 @@
                }
 #endif
                /*
-                * Mark it unmodified to avoid pageout
+                * page is unused, free it now!
                 */
-               pmap_changebit(pa, 0, ~PG_M);
+               pmap_remove_mapping(pv->pv_pmap, pv->pv_va,
+                                   NULL, PRM_TFLUSH|PRM_CFLUSH);
+               uvm_pagefree(PHYS_TO_VM_PAGE(pa));
 #ifdef DEBUG
-               if ((PHYS_TO_VM_PAGE(pa)->flags & PG_CLEAN) == 0) {
-                       printf("pa %lx: flags=%x: not clean\n",
-                              pa, PHYS_TO_VM_PAGE(pa)->flags);
-                       PHYS_TO_VM_PAGE(pa)->flags |= PG_CLEAN;
-               }
                if (pmapdebug & PDB_PTPAGE)
-                       printf("pmap_pageable: PT page %lx(%x) unmodified\n",
+                       printf("pmap_pageable: PT page %lx(%x) freed\n",
                               sva, *pmap_pte(pmap, sva));
-               if (pmapdebug & PDB_WIRING)
-                       pmap_check_wiring("pageable", sva);
 #endif
        }
 }
diff -r 7c16fb65e1f2 -r ff19233501a0 sys/arch/next68k/next68k/pmap.c
--- a/sys/arch/next68k/next68k/pmap.c   Thu Apr 22 04:20:53 1999 +0000
+++ b/sys/arch/next68k/next68k/pmap.c   Thu Apr 22 04:24:52 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.12 1999/03/27 05:57:05 mycroft Exp $        */
+/*     $NetBSD: pmap.c,v 1.13 1999/04/22 04:24:54 chs Exp $        */
 
 /*
  * This file was taken from mvme68k/mvme68k/pmap.c
@@ -1894,20 +1894,15 @@
                }
 #endif
                /*
-                * Mark it unmodified to avoid pageout
+                * page is unused, free it now!
                 */
-               pmap_changebit(pa, PG_M, FALSE);
+               pmap_remove_mapping(pv->pv_pmap, pv->pv_va,
+                                   NULL, PRM_TFLUSH|PRM_CFLUSH);
+               uvm_pagefree(PHYS_TO_VM_PAGE(pa));
 #ifdef DEBUG
-               if ((PHYS_TO_VM_PAGE(pa)->flags & PG_CLEAN) == 0) {
-                       printf("pa %lx: flags=%x: not clean\n",
-                              pa, PHYS_TO_VM_PAGE(pa)->flags);
-                       PHYS_TO_VM_PAGE(pa)->flags |= PG_CLEAN;
-               }
                if (pmapdebug & PDB_PTPAGE)
-                       printf("pmap_pageable: PT page %lx(%x) unmodified\n",
+                       printf("pmap_pageable: PT page %lx(%x) freed\n",
                               sva, *pmap_pte(pmap, sva));
-               if (pmapdebug & PDB_WIRING)
-                       pmap_check_wiring("pageable", sva);
 #endif
        }
 }
diff -r 7c16fb65e1f2 -r ff19233501a0 sys/arch/x68k/x68k/pmap.c
--- a/sys/arch/x68k/x68k/pmap.c Thu Apr 22 04:20:53 1999 +0000
+++ b/sys/arch/x68k/x68k/pmap.c Thu Apr 22 04:24:52 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.31 1999/03/27 05:57:06 mycroft Exp $        */
+/*     $NetBSD: pmap.c,v 1.32 1999/04/22 04:24:54 chs Exp $    */
 
 /* 
  * Copyright (c) 1991, 1993
@@ -1831,20 +1831,15 @@
                }
 #endif
                /*
-                * Mark it unmodified to avoid pageout
+                * page is unused, free it now!
                 */
-               pmap_changebit(pa, 0, ~PG_M);
+               pmap_remove_mapping(pv->pv_pmap, pv->pv_va,
+                                   NULL, PRM_TFLUSH|PRM_CFLUSH);
+               uvm_pagefree(PHYS_TO_VM_PAGE(pa));
 #ifdef DEBUG
-               if ((PHYS_TO_VM_PAGE(pa)->flags & PG_CLEAN) == 0) {
-                       printf("pa %lx: flags=%x: not clean\n",
-                              pa, PHYS_TO_VM_PAGE(pa)->flags);
-                       PHYS_TO_VM_PAGE(pa)->flags |= PG_CLEAN;
-               }
                if (pmapdebug & PDB_PTPAGE)
-                       printf("pmap_pageable: PT page %lx(%x) unmodified\n",
+                       printf("pmap_pageable: PT page %lx(%x) freed\n",
                               sva, *pmap_pte(pmap, sva));
-               if (pmapdebug & PDB_WIRING)
-                       pmap_check_wiring("pageable", sva);
 #endif
        }
 }



Home | Main Index | Thread Index | Old Index