Module Name:    src
Committed By:   uebayasi
Date:           Thu Jul 22 07:49:46 UTC 2010

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

Log Message:
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.)


To generate a diff of this commit:
cvs rdiff -u -r1.36.2.17 -r1.36.2.18 src/sys/miscfs/genfs/genfs_io.c
cvs rdiff -u -r1.68.2.9 -r1.68.2.10 src/sys/uvm/uvm_bio.c
cvs rdiff -u -r1.166.2.18 -r1.166.2.19 src/sys/uvm/uvm_fault.c
cvs rdiff -u -r1.153.2.45 -r1.153.2.46 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.59.2.26 -r1.59.2.27 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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.36.2.17 src/sys/miscfs/genfs/genfs_io.c:1.36.2.18
--- src/sys/miscfs/genfs/genfs_io.c:1.36.2.17	Tue Jul 20 15:43:48 2010
+++ src/sys/miscfs/genfs/genfs_io.c	Thu Jul 22 07:49:46 2010
@@ -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;

Index: src/sys/uvm/uvm_bio.c
diff -u src/sys/uvm/uvm_bio.c:1.68.2.9 src/sys/uvm/uvm_bio.c:1.68.2.10
--- src/sys/uvm/uvm_bio.c:1.68.2.9	Thu Jul 15 08:33:46 2010
+++ src/sys/uvm/uvm_bio.c	Thu Jul 22 07:49:45 2010
@@ -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);

Index: src/sys/uvm/uvm_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.166.2.18 src/sys/uvm/uvm_fault.c:1.166.2.19
--- src/sys/uvm/uvm_fault.c:1.166.2.18	Thu Jul 15 08:33:46 2010
+++ src/sys/uvm/uvm_fault.c	Thu Jul 22 07:49:45 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_fault.c,v 1.166.2.18 2010/07/15 08:33:46 uebayasi Exp $	*/
+/*	$NetBSD: uvm_fault.c,v 1.166.2.19 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.18 2010/07/15 08:33:46 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.19 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);

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.45 src/sys/uvm/uvm_page.c:1.153.2.46
--- src/sys/uvm/uvm_page.c:1.153.2.45	Thu Jul 15 08:33:46 2010
+++ src/sys/uvm/uvm_page.c	Thu Jul 22 07:49:45 2010
@@ -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

Index: src/sys/uvm/uvm_page.h
diff -u src/sys/uvm/uvm_page.h:1.59.2.26 src/sys/uvm/uvm_page.h:1.59.2.27
--- src/sys/uvm/uvm_page.h:1.59.2.26	Thu Jul 15 08:33:46 2010
+++ src/sys/uvm/uvm_page.h	Thu Jul 22 07:49:45 2010
@@ -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

Reply via email to