Module Name:    src
Committed By:   uebayasi
Date:           Thu Jul 15 08:33:47 UTC 2010

Modified Files:
        src/sys/uvm [uebayasi-xip]: uvm_bio.c uvm_fault.c uvm_page.c uvm_page.h

Log Message:
Rename PG_DIRECT to PG_XIP.  PG_XIP is marked to XIP vnode pages.


To generate a diff of this commit:
cvs rdiff -u -r1.68.2.8 -r1.68.2.9 src/sys/uvm/uvm_bio.c
cvs rdiff -u -r1.166.2.17 -r1.166.2.18 src/sys/uvm/uvm_fault.c
cvs rdiff -u -r1.153.2.44 -r1.153.2.45 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.59.2.25 -r1.59.2.26 src/sys/uvm/uvm_page.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/uvm_bio.c
diff -u src/sys/uvm/uvm_bio.c:1.68.2.8 src/sys/uvm/uvm_bio.c:1.68.2.9
--- src/sys/uvm/uvm_bio.c:1.68.2.8	Tue Jul 13 01:47:23 2010
+++ src/sys/uvm/uvm_bio.c	Thu Jul 15 08:33:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_bio.c,v 1.68.2.8 2010/07/13 01:47:23 uebayasi Exp $	*/
+/*	$NetBSD: uvm_bio.c,v 1.68.2.9 2010/07/15 08:33:46 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.8 2010/07/13 01:47:23 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.68.2.9 2010/07/15 08:33:46 uebayasi Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_ubc.h"
@@ -387,15 +387,11 @@
 		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 (uvm_pageisdirect_p(pg))
-			goto ubc_fault_done;
-
-		mutex_enter(&uvm_pageqlock);
-		uvm_pageactivate(pg);
-		mutex_exit(&uvm_pageqlock);
-
-ubc_fault_done:
+		if (__predict_true((pg->flags & PG_XIP) == 0)) {
+			mutex_enter(&uvm_pageqlock);
+			uvm_pageactivate(pg);
+			mutex_exit(&uvm_pageqlock);
+		}
 		pg->flags &= ~(PG_BUSY|PG_WANTED);
 		UVM_PAGE_OWN(pg, NULL);
 		mutex_exit(&uobj->vmobjlock);

Index: src/sys/uvm/uvm_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.166.2.17 src/sys/uvm/uvm_fault.c:1.166.2.18
--- src/sys/uvm/uvm_fault.c:1.166.2.17	Wed Jul 14 06:33:31 2010
+++ src/sys/uvm/uvm_fault.c	Thu Jul 15 08:33:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_fault.c,v 1.166.2.17 2010/07/14 06:33:31 uebayasi Exp $	*/
+/*	$NetBSD: uvm_fault.c,v 1.166.2.18 2010/07/15 08:33:46 uebayasi Exp $	*/
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.17 2010/07/14 06:33:31 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.18 2010/07/15 08:33:46 uebayasi Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_xip.h"
@@ -1754,20 +1754,17 @@
 
 	/* locked: maps(read), amap(if there), uobj */
 
-	if (uvm_pageisdirect_p(pg))
-		goto uvm_fault_lower_neighbor_enter;
-
 	/*
 	 * calling pgo_get with PGO_LOCKED returns us pages which
 	 * are neither busy nor released, so we don't need to check
 	 * for this.  we can just directly enter the pages.
 	 */
 
-	mutex_enter(&uvm_pageqlock);
-	uvm_pageenqueue(pg);
-	mutex_exit(&uvm_pageqlock);
-
-uvm_fault_lower_neighbor_enter:
+	if (__predict_true((pg->flags & PG_XIP) == 0)) {
+		mutex_enter(&uvm_pageqlock);
+		uvm_pageenqueue(pg);
+		mutex_exit(&uvm_pageqlock);
+	}
 	UVMHIST_LOG(maphist,
 	    "  MAPPING: n obj: pm=0x%x, va=0x%x, pg=0x%x",
 	    ufi->orig_map->pmap, currva, pg, 0);
@@ -2195,7 +2192,7 @@
 		return ERESTART;
 	}
 
-	if (!uvm_pageisdirect_p(pg))
+	if (__predict_true((pg->flags & PG_XIP) == 0))
 		uvm_fault_lower_done(ufi, flt, uobj, anon, pg);
 
 	pg->flags &= ~(PG_BUSY|PG_FAKE|PG_WANTED);

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.44 src/sys/uvm/uvm_page.c:1.153.2.45
--- src/sys/uvm/uvm_page.c:1.153.2.44	Mon Jul 12 06:25:14 2010
+++ src/sys/uvm/uvm_page.c	Thu Jul 15 08:33:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.153.2.44 2010/07/12 06:25:14 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.153.2.45 2010/07/15 08:33:46 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.44 2010/07/12 06:25:14 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.45 2010/07/15 08:33:46 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -870,7 +870,7 @@
 		paddr_t paddr = (start + i) << PAGE_SHIFT;
 
 		pg->phys_addr = paddr;
-		pg->flags |= PG_FAKE | PG_RDONLY | PG_DIRECT | PG_CLEAN;
+		pg->flags |= PG_FAKE | PG_RDONLY | PG_XIP | PG_CLEAN;
 #ifdef __HAVE_VM_PAGE_MD
 		VM_MDPAGE_INIT(&pg->mdpage, paddr);
 #endif
@@ -1173,14 +1173,6 @@
 	}
 }
 
-bool
-uvm_pageisdirect_p(const struct vm_page *pg)
-{
-
-	KASSERT(pg != NULL);
-	return (pg->flags & PG_DIRECT) != 0;
-}
-
 
 /*
  * PHYS_TO_VM_PAGE: find vm_page for a PA.   used by MI code to get vm_pages

Index: src/sys/uvm/uvm_page.h
diff -u src/sys/uvm/uvm_page.h:1.59.2.25 src/sys/uvm/uvm_page.h:1.59.2.26
--- src/sys/uvm/uvm_page.h:1.59.2.25	Thu Jul  8 07:47:37 2010
+++ src/sys/uvm/uvm_page.h	Thu Jul 15 08:33:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.h,v 1.59.2.25 2010/07/08 07:47:37 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.h,v 1.59.2.26 2010/07/15 08:33:46 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -180,7 +180,7 @@
 #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_DIRECT	0x0200		/* page is direct vnode data */
+#define	PG_XIP		0x0200		/* page is XIP vnode data */
 
 #define PG_PAGER1	0x1000		/* pager-specific flag */
 
@@ -304,7 +304,6 @@
 void uvm_pagewire(struct vm_page *);
 void uvm_pagezero(struct vm_page *);
 bool uvm_pageismanaged(paddr_t);
-bool uvm_pageisdirect_p(const struct vm_page *);
 
 int uvm_page_lookup_freelist(struct vm_page *);
 

Reply via email to