Source-Changes-HG archive

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

[src/uebayasi-xip]: src/sys s/PG_XIP/PQ_FIXED/, meaning that the fault handle...



details:   https://anonhg.NetBSD.org/src/rev/142a025ed5c2
branches:  uebayasi-xip
changeset: 751747:142a025ed5c2
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Thu Jul 22 07:49:45 2010 +0000

description:
s/PG_XIP/PQ_FIXED/, meaning that the fault handler sees XIP pages as
"fixed", and doesn't pass them to paging activity.

("XIP" is a vnode specific knowledge.  It was wrong that the fault
handler had to know such a special thing.)

diffstat:

 sys/miscfs/genfs/genfs_io.c |  6 +++---
 sys/uvm/uvm_bio.c           |  6 +++---
 sys/uvm/uvm_fault.c         |  8 ++++----
 sys/uvm/uvm_page.c          |  8 +++++---
 sys/uvm/uvm_page.h          |  4 ++--
 5 files changed, 17 insertions(+), 15 deletions(-)

diffs (144 lines):

diff -r 0a9da5f4da82 -r 142a025ed5c2 sys/miscfs/genfs/genfs_io.c
--- a/sys/miscfs/genfs/genfs_io.c       Tue Jul 20 15:43:48 2010 +0000
+++ b/sys/miscfs/genfs/genfs_io.c       Thu Jul 22 07:49:45 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfs_io.c,v 1.36.2.17 2010/07/20 15:43:48 uebayasi Exp $      */
+/*     $NetBSD: genfs_io.c,v 1.36.2.18 2010/07/22 07:49:46 uebayasi Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.17 2010/07/20 15:43:48 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.18 2010/07/22 07:49:46 uebayasi Exp $");
 
 #include "opt_xip.h"
 
@@ -873,7 +873,7 @@
                        KASSERT((pg->flags & PG_BUSY) == 0);
                        KASSERT((pg->flags & PG_RDONLY) != 0);
                        KASSERT((pg->flags & PG_CLEAN) != 0);
-                       KASSERT((pg->flags & PG_XIP) != 0);
+                       KASSERT((pg->pqflags & PQ_FIXED) != 0);
                        pg->flags |= PG_BUSY;
                        pg->flags &= ~PG_FAKE;
                        pg->uobject = &vp->v_uobj;
diff -r 0a9da5f4da82 -r 142a025ed5c2 sys/uvm/uvm_bio.c
--- a/sys/uvm/uvm_bio.c Tue Jul 20 15:43:48 2010 +0000
+++ b/sys/uvm/uvm_bio.c Thu Jul 22 07:49:45 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_bio.c,v 1.68.2.9 2010/07/15 08:33:46 uebayasi Exp $        */
+/*     $NetBSD: uvm_bio.c,v 1.68.2.10 2010/07/22 07:49:45 uebayasi Exp $       */
 
 /*
  * Copyright (c) 1998 Chuck Silvers.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.68.2.9 2010/07/15 08:33:46 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.68.2.10 2010/07/22 07:49:45 uebayasi Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_ubc.h"
@@ -387,7 +387,7 @@
                mask = rdonly ? ~VM_PROT_WRITE : VM_PROT_ALL;
                error = pmap_enter(ufi->orig_map->pmap, va, VM_PAGE_TO_PHYS(pg),
                    prot & mask, PMAP_CANFAIL | (access_type & mask));
-               if (__predict_true((pg->flags & PG_XIP) == 0)) {
+               if (__predict_true((pg->pqflags & PQ_FIXED) == 0)) {
                        mutex_enter(&uvm_pageqlock);
                        uvm_pageactivate(pg);
                        mutex_exit(&uvm_pageqlock);
diff -r 0a9da5f4da82 -r 142a025ed5c2 sys/uvm/uvm_fault.c
--- a/sys/uvm/uvm_fault.c       Tue Jul 20 15:43:48 2010 +0000
+++ b/sys/uvm/uvm_fault.c       Thu Jul 22 07:49:45 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_fault.c,v 1.166.2.19 2010/07/15 08:33:46 uebayasi Exp $    */
+/*     $NetBSD: uvm_fault.c,v 1.166.2.20 2010/07/22 07:49:45 uebayasi Exp $    */
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.19 2010/07/15 08:33:46 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.20 2010/07/22 07:49:45 uebayasi Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_xip.h"
@@ -1760,7 +1760,7 @@
         * for this.  we can just directly enter the pages.
         */
 
-       if (__predict_true((pg->flags & PG_XIP) == 0)) {
+       if (__predict_true((pg->pqflags & PQ_FIXED) == 0)) {
                mutex_enter(&uvm_pageqlock);
                uvm_pageenqueue(pg);
                mutex_exit(&uvm_pageqlock);
@@ -2192,7 +2192,7 @@
                return ERESTART;
        }
 
-       if (__predict_true((pg->flags & PG_XIP) == 0))
+       if (__predict_true((pg->pqflags & PQ_FIXED) == 0))
                uvm_fault_lower_done(ufi, flt, uobj, anon, pg);
 
        pg->flags &= ~(PG_BUSY|PG_FAKE|PG_WANTED);
diff -r 0a9da5f4da82 -r 142a025ed5c2 sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c        Tue Jul 20 15:43:48 2010 +0000
+++ b/sys/uvm/uvm_page.c        Thu Jul 22 07:49:45 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.c,v 1.153.2.45 2010/07/15 08:33:46 uebayasi Exp $     */
+/*     $NetBSD: uvm_page.c,v 1.153.2.46 2010/07/22 07:49:45 uebayasi Exp $     */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.45 2010/07/15 08:33:46 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.46 2010/07/22 07:49:45 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -870,7 +870,9 @@
                paddr_t paddr = (start + i) << PAGE_SHIFT;
 
                pg->phys_addr = paddr;
-               pg->flags |= PG_FAKE | PG_RDONLY | PG_XIP | PG_CLEAN;
+               pg->flags |= PG_FAKE | PG_RDONLY | PG_CLEAN;
+               KASSERT(pg->pqflags == 0);
+               pg->pqflags = PQ_FIXED;
 #ifdef __HAVE_VM_PAGE_MD
                VM_MDPAGE_INIT(&pg->mdpage, paddr);
 #endif
diff -r 0a9da5f4da82 -r 142a025ed5c2 sys/uvm/uvm_page.h
--- a/sys/uvm/uvm_page.h        Tue Jul 20 15:43:48 2010 +0000
+++ b/sys/uvm/uvm_page.h        Thu Jul 22 07:49:45 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.h,v 1.59.2.26 2010/07/15 08:33:46 uebayasi Exp $      */
+/*     $NetBSD: uvm_page.h,v 1.59.2.27 2010/07/22 07:49:45 uebayasi Exp $      */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -180,7 +180,6 @@
 #define        PG_FAKE         0x0040          /* page is not yet initialized */
 #define        PG_RDONLY       0x0080          /* page must be mapped read-only */
 #define        PG_ZERO         0x0100          /* page is pre-zero'd */
-#define        PG_XIP          0x0200          /* page is XIP vnode data */
 
 #define PG_PAGER1      0x1000          /* pager-specific flag */
 
@@ -195,6 +194,7 @@
                                           uvm_object */
 #define PQ_SWAPBACKED  (PQ_ANON|PQ_AOBJ)
 #define PQ_READAHEAD   0x0008  /* read-ahead but has not been "hit" yet */
+#define PQ_FIXED       0x0010  /* resident page (never paged out) */
 
 #define PQ_PRIVATE1    0x0100
 #define PQ_PRIVATE2    0x0200



Home | Main Index | Thread Index | Old Index