Source-Changes-HG archive

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

[src/uebayasi-xip]: src/sys Rename PGO_ZERO as PGO_HOLE, and s/uvm_page_zerop...



details:   https://anonhg.NetBSD.org/src/rev/96592cd0f275
branches:  uebayasi-xip
changeset: 751899:96592cd0f275
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Sun Nov 21 15:00:12 2010 +0000

description:
Rename PGO_ZERO as PGO_HOLE, and s/uvm_page_zeropage/uvm_page_holepage/.

diffstat:

 sys/miscfs/genfs/genfs_io.c |  10 ++++----
 sys/uvm/uvm_bio.c           |  24 ++++++++++----------
 sys/uvm/uvm_fault.c         |  50 ++++++++++++++++++++++----------------------
 sys/uvm/uvm_pager.h         |   6 ++--
 4 files changed, 45 insertions(+), 45 deletions(-)

diffs (truncated from 328 to 300 lines):

diff -r 48a3c437afd1 -r 96592cd0f275 sys/miscfs/genfs/genfs_io.c
--- a/sys/miscfs/genfs/genfs_io.c       Sun Nov 21 14:52:48 2010 +0000
+++ b/sys/miscfs/genfs/genfs_io.c       Sun Nov 21 15:00:12 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfs_io.c,v 1.36.2.61 2010/11/21 14:52:23 uebayasi Exp $      */
+/*     $NetBSD: genfs_io.c,v 1.36.2.62 2010/11/21 15:00:12 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.61 2010/11/21 14:52:23 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.62 2010/11/21 15:00:12 uebayasi Exp $");
 
 #include "opt_xip.h"
 
@@ -672,7 +672,7 @@
                        }
                    } else {
                        for (i = 0; i < holepages; i++) {
-                               pgs[ridx + pidx + i] = PGO_ZERO;
+                               pgs[ridx + pidx + i] = PGO_HOLE;
                        }
                        UVMHIST_LOG(ubchist, "xip HOLE pgs %d .. %d",
                            pidx, pidx + holepages - 1, 0, 0);
@@ -901,7 +901,7 @@
        for (i = ridx; i < ridx + npages; i++) {
                struct vm_page *pg = pgs[i];
 
-           if (pg != PGO_ZERO) {
+           if (pg != PGO_HOLE) {
                KASSERT(pg != NULL);
                KASSERT((pg->flags & PG_RDONLY) != 0);
                KASSERT((pg->flags & PG_BUSY) != 0);
@@ -920,7 +920,7 @@
                 * XIP hole pages are passed as a magic pointer
                 * back to fault handlers.  Fault handlers are
                 * respoinsible to check it and redirect the VA to
-                * a single "zero page".
+                * a single zero'ed "hole page".
                 */
            }
        }
diff -r 48a3c437afd1 -r 96592cd0f275 sys/uvm/uvm_bio.c
--- a/sys/uvm/uvm_bio.c Sun Nov 21 14:52:48 2010 +0000
+++ b/sys/uvm/uvm_bio.c Sun Nov 21 15:00:12 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_bio.c,v 1.68.2.13 2010/11/21 12:42:59 uebayasi Exp $       */
+/*     $NetBSD: uvm_bio.c,v 1.68.2.14 2010/11/21 15:00:12 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.13 2010/11/21 12:42:59 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.68.2.14 2010/11/21 15:00:12 uebayasi Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_ubc.h"
@@ -234,10 +234,10 @@
        UVMHIST_FUNC("ubc_fault_page"); UVMHIST_CALLED(ubchist);
 
        KASSERT(pg != NULL);
-       KASSERT(pg == PGO_ZERO || uobj == pg->uobject);
+       KASSERT(pg == PGO_HOLE || uobj == pg->uobject);
        KASSERT(mutex_owned(&uobj->vmobjlock));
 
-    if (__predict_true(pg != PGO_ZERO)) {
+    if (__predict_true(pg != PGO_HOLE)) {
        if (pg->flags & PG_WANTED) {
                wakeup(pg);
        }
@@ -275,17 +275,17 @@
         * is marked as PG_RDONLY.
         */
 
-       KASSERT(pg == PGO_ZERO ||
+       KASSERT(pg == PGO_HOLE ||
            (pg->flags & PG_RDONLY) == 0 ||
            (access_type & VM_PROT_WRITE) == 0 ||
            pg->offset < umap->writeoff ||
            pg->offset + PAGE_SIZE > umap->writeoff + umap->writelen);
 
-       if (__predict_false(pg == PGO_ZERO)) {
-               UVMHIST_LOG(ubchist, "replacing PGO_ZERO with zeropage",0,0,0,0);
-               pg = uvm_page_zeropage_alloc();
+       if (__predict_false(pg == PGO_HOLE)) {
+               UVMHIST_LOG(ubchist, "replacing PGO_HOLE with holepage",0,0,0,0);
+               pg = uvm_page_holepage_alloc();
                UVMHIST_LOG(ubchist,
-                   "PGO_ZERO replaced with pg %p (phys_addr=0x%lx)",
+                   "PGO_HOLE replaced with pg %p (phys_addr=0x%lx)",
                    pg, VM_PAGE_TO_PHYS(pg), 0, 0);
                KASSERT(pg != NULL);
                KASSERT((pg->flags & PG_RDONLY) != 0);
@@ -299,7 +299,7 @@
        error = pmap_enter(ufi->orig_map->pmap, va, VM_PAGE_TO_PHYS(pg),
            prot & mask, PMAP_CANFAIL | (access_type & mask));
 
-    if (__predict_true(pg != uvm_page_zeropage)) {
+    if (__predict_true(pg != uvm_page_holepage)) {
        if (__predict_true((pg->flags & PG_DEVICE) == 0)) {
                mutex_enter(&uvm_pageqlock);
                uvm_pageactivate(pg);
@@ -440,7 +440,7 @@
                if (pg == NULL || pg == PGO_DONTCARE) {
                        continue;
                }
-           if (__predict_true(pg != PGO_ZERO)) {
+           if (__predict_true(pg != PGO_HOLE)) {
                if (__predict_false(pg->uobject != uobj)) {
                        /* Check for the first iteration and error cases. */
                        if (uobj != NULL) {
@@ -457,7 +457,7 @@
                        mutex_enter(&uobj->vmobjlock);
                }
            }
-               KASSERT(pg == PGO_ZERO || uobj == pg->uobject);
+               KASSERT(pg == PGO_HOLE || uobj == pg->uobject);
                error = ubc_fault_page(ufi, umap, uobj, pg, prot, access_type, va);
                if (error) {
                        /*
diff -r 48a3c437afd1 -r 96592cd0f275 sys/uvm/uvm_fault.c
--- a/sys/uvm/uvm_fault.c       Sun Nov 21 14:52:48 2010 +0000
+++ b/sys/uvm/uvm_fault.c       Sun Nov 21 15:00:12 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_fault.c,v 1.166.2.26 2010/11/21 14:52:48 uebayasi Exp $    */
+/*     $NetBSD: uvm_fault.c,v 1.166.2.27 2010/11/21 15:00:12 uebayasi Exp $    */
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.26 2010/11/21 14:52:48 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.27 2010/11/21 15:00:12 uebayasi Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_xip.h"
@@ -564,7 +564,7 @@
                opg = oanon->an_page;
                KASSERT(opg != NULL);
                KASSERT(opg->uobject == NULL || opg->loan_count > 0);
-       } else if (uobjpage != PGO_DONTCARE && uobjpage != PGO_ZERO) {
+       } else if (uobjpage != PGO_DONTCARE && uobjpage != PGO_HOLE) {
                /* object-backed COW */
                opg = uobjpage;
        } else {
@@ -579,7 +579,7 @@
 
        KASSERT(amap != NULL);
        KASSERT(uobjpage != NULL);
-       KASSERT(uobjpage == PGO_DONTCARE || uobjpage == PGO_ZERO || (uobjpage->flags & PG_BUSY) != 0);
+       KASSERT(uobjpage == PGO_DONTCARE || uobjpage == PGO_HOLE || (uobjpage->flags & PG_BUSY) != 0);
        KASSERT(mutex_owned(&amap->am_l));
        KASSERT(oanon == NULL || mutex_owned(&oanon->an_lock));
        KASSERT(uobj == NULL || mutex_owned(&uobj->vmobjlock));
@@ -1654,7 +1654,7 @@
         */
        KASSERT(amap == NULL || mutex_owned(&amap->am_l));
        KASSERT(uobj == NULL || mutex_owned(&uobj->vmobjlock));
-       KASSERT(uobj == NULL || uobjpage == PGO_ZERO || (uobjpage->flags & PG_BUSY) != 0);
+       KASSERT(uobj == NULL || uobjpage == PGO_HOLE || (uobjpage->flags & PG_BUSY) != 0);
 
        /*
         * notes:
@@ -1664,8 +1664,8 @@
         *  - at this point uobjpage could be PG_WANTED (handle later)
         */
 
-       KASSERT(uobj == NULL || uobjpage == PGO_ZERO || (uobjpage->flags & PG_DEVICE) != 0 || uobj == uobjpage->uobject);
-       KASSERT(uobj == NULL || uobjpage == PGO_ZERO || !UVM_OBJ_IS_CLEAN(uobjpage->uobject) ||
+       KASSERT(uobj == NULL || uobjpage == PGO_HOLE || (uobjpage->flags & PG_DEVICE) != 0 || uobj == uobjpage->uobject);
+       KASSERT(uobj == NULL || uobjpage == PGO_HOLE || !UVM_OBJ_IS_CLEAN(uobjpage->uobject) ||
            (uobjpage->flags & PG_CLEAN) != 0);
 
        if (flt->promote == false) {
@@ -1867,10 +1867,10 @@
 
        KASSERT(pg != 0);
 
-    if (pg != PGO_ZERO) {
+    if (pg != PGO_HOLE) {
        KASSERT((pg->flags & PG_BUSY) != 0);
 
-       if (pg != PGO_ZERO && (pg->flags & PG_DEVICE) == 0) {
+       if (pg != PGO_HOLE && (pg->flags & PG_DEVICE) == 0) {
                mutex_enter(&uvm_pageqlock);
                uvm_pageactivate(pg);
                mutex_exit(&uvm_pageqlock);
@@ -1886,7 +1886,7 @@
        if (locked && amap)
                amap_lock(amap);
 
-    if (pg != PGO_ZERO) {
+    if (pg != PGO_HOLE) {
        /* might be changed */
        uobj = pg->uobject;
     } else {
@@ -1904,7 +1904,7 @@
         * we unlock and clean up.
         */
 
-       if ((pg != PGO_ZERO && (pg->flags & PG_RELEASED) != 0) ||
+       if ((pg != PGO_HOLE && (pg->flags & PG_RELEASED) != 0) ||
            (locked && amap && amap_lookup(&ufi->entry->aref,
              ufi->orig_rvaddr - ufi->entry->start))) {
                if (locked)
@@ -1920,7 +1920,7 @@
                UVMHIST_LOG(maphist,
                    "  wasn't able to relock after fault: retry",
                    0,0,0,0);
-           if (pg != PGO_ZERO) {
+           if (pg != PGO_HOLE) {
                if (pg->flags & PG_WANTED) {
                        wakeup(pg);
                }
@@ -1976,7 +1976,7 @@
 
        uvmexp.flt_obj++;
        if (UVM_ET_ISCOPYONWRITE(ufi->entry) ||
-           uobjpage == PGO_ZERO ||
+           uobjpage == PGO_HOLE ||
            UVM_OBJ_NEEDS_WRITEFAULT(uobjpage->uobject))
                flt->enter_prot &= ~VM_PROT_WRITE;
        pg = uobjpage;          /* map in the actual object */
@@ -1988,7 +1988,7 @@
         * about writing to loaned pages...
         */
 
-       if (pg != PGO_ZERO && uobjpage->loan_count) {
+       if (pg != PGO_HOLE && uobjpage->loan_count) {
                uvm_fault_lower_direct_loan(ufi, flt, uobj, &pg, &uobjpage);
        }
        KASSERT(pg == uobjpage);
@@ -2090,7 +2090,7 @@
         * fill in the data
         */
 
-       if (uobjpage != PGO_DONTCARE && uobjpage != PGO_ZERO) {
+       if (uobjpage != PGO_DONTCARE && uobjpage != PGO_HOLE) {
                uvmexp.flt_prcopy++;
 
                /*
@@ -2132,7 +2132,7 @@
                 */
 
                UVMHIST_LOG(maphist,"  zero fill anon/page 0x%x/0%x%s",
-                   anon, pg, (pg == PGO_ZERO) ? " (xip hole)" : "", 0);
+                   anon, pg, (pg == PGO_HOLE) ? " (xip hole)" : "", 0);
        }
 
        return uvm_fault_lower_enter(ufi, flt, uobj, anon, pg, uobjpage);
@@ -2161,16 +2161,16 @@
         */
        KASSERT(amap == NULL || mutex_owned(&amap->am_l));
        KASSERT(uobj == NULL || mutex_owned(&uobj->vmobjlock));
-       KASSERT(uobj == NULL || uobjpage == PGO_ZERO || (uobjpage->flags & PG_BUSY) != 0);
+       KASSERT(uobj == NULL || uobjpage == PGO_HOLE || (uobjpage->flags & PG_BUSY) != 0);
        KASSERT(anon == NULL || mutex_owned(&anon->an_lock));
-       KASSERT(pg == PGO_ZERO || (pg->flags & PG_BUSY) != 0);
+       KASSERT(pg == PGO_HOLE || (pg->flags & PG_BUSY) != 0);
 
 #ifdef XIP
-       if (pg == PGO_ZERO) {
-               UVMHIST_LOG(maphist, "replacing PGO_ZERO with zeropage",0,0,0,0);
-               pg = uvm_page_zeropage_alloc();
+       if (pg == PGO_HOLE) {
+               UVMHIST_LOG(maphist, "replacing PGO_HOLE with holepage",0,0,0,0);
+               pg = uvm_page_holepage_alloc();
                UVMHIST_LOG(maphist,
-                   "PGO_ZERO replaced with pg %p (phys_addr=0x%lx)",
+                   "PGO_HOLE replaced with pg %p (phys_addr=0x%lx)",
                    pg, VM_PAGE_TO_PHYS(pg), 0, 0);
                KASSERT(pg != NULL);
                KASSERT((pg->flags & PG_RDONLY) != 0);
@@ -2199,7 +2199,7 @@
                 * as the map may change while we're asleep.
                 */
 
-           if (pg != uvm_page_zeropage) {
+           if (pg != uvm_page_holepage) {
                if (pg->flags & PG_WANTED)
                        wakeup(pg);
 
@@ -2226,7 +2226,7 @@
                return ERESTART;
        }
 
-    if (pg != uvm_page_zeropage) {
+    if (pg != uvm_page_holepage) {
        if (__predict_true((pg->flags & PG_DEVICE) == 0))
                uvm_fault_lower_done(ufi, flt, uobj, anon, pg);
 
@@ -2254,7 +2254,7 @@



Home | Main Index | Thread Index | Old Index