Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/uebayasi-xip]: src/sys Reduce more diff by backing out XIP page specific...
details: https://anonhg.NetBSD.org/src/rev/7320a219eee8
branches: uebayasi-xip
changeset: 751741:7320a219eee8
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Mon Jul 12 06:25:14 2010 +0000
description:
Reduce more diff by backing out XIP page specific code. Allow XIP pages
to be loaned.
diffstat:
sys/miscfs/genfs/genfs_io.c | 5 +++--
sys/uvm/uvm_bio.c | 13 +++----------
sys/uvm/uvm_fault.c | 28 ++++++++--------------------
sys/uvm/uvm_loan.c | 11 +++--------
sys/uvm/uvm_object.c | 7 ++-----
sys/uvm/uvm_page.c | 6 +++---
6 files changed, 22 insertions(+), 48 deletions(-)
diffs (256 lines):
diff -r f570cfafa7b0 -r 7320a219eee8 sys/miscfs/genfs/genfs_io.c
--- a/sys/miscfs/genfs/genfs_io.c Mon Jul 12 02:28:33 2010 +0000
+++ b/sys/miscfs/genfs/genfs_io.c Mon Jul 12 06:25:14 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfs_io.c,v 1.36.2.14 2010/07/09 12:57:42 uebayasi Exp $ */
+/* $NetBSD: genfs_io.c,v 1.36.2.15 2010/07/12 06:25:15 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.14 2010/07/09 12:57:42 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.15 2010/07/12 06:25:15 uebayasi Exp $");
#include "opt_xip.h"
@@ -878,6 +878,7 @@
KASSERT((pg->flags & PG_CLEAN) != 0);
KASSERT((pg->flags & PG_DIRECT) != 0);
pg->flags |= PG_BUSY;
+ pg->flags &= ~PG_FAKE;
pg->uobject = &vp->v_uobj;
}
}
diff -r f570cfafa7b0 -r 7320a219eee8 sys/uvm/uvm_bio.c
--- a/sys/uvm/uvm_bio.c Mon Jul 12 02:28:33 2010 +0000
+++ b/sys/uvm/uvm_bio.c Mon Jul 12 06:25:14 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_bio.c,v 1.68.2.6 2010/07/09 12:49:21 uebayasi Exp $ */
+/* $NetBSD: uvm_bio.c,v 1.68.2.7 2010/07/12 06:25:14 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.6 2010/07/09 12:49:21 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.68.2.7 2010/07/12 06:25:14 uebayasi Exp $");
#include "opt_uvmhist.h"
#include "opt_ubc.h"
@@ -336,14 +336,8 @@
continue;
}
+ KASSERT(uobj == pg->uobject);
mutex_enter(&uobj->vmobjlock);
-
- if (uvm_pageisdirect_p(pg)) {
- UVMHIST_LOG(ubchist, "pg is device", i, 0,0,0);
- goto ubc_fault_enter;
- }
-
- KASSERT(uobj == pg->uobject);
if (pg->flags & PG_WANTED) {
wakeup(pg);
@@ -379,7 +373,6 @@
}
}
-ubc_fault_enter:
/*
* note that a page whose backing store is partially allocated
* is marked as PG_RDONLY.
diff -r f570cfafa7b0 -r 7320a219eee8 sys/uvm/uvm_fault.c
--- a/sys/uvm/uvm_fault.c Mon Jul 12 02:28:33 2010 +0000
+++ b/sys/uvm/uvm_fault.c Mon Jul 12 06:25:14 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_fault.c,v 1.166.2.15 2010/07/12 02:28:33 uebayasi Exp $ */
+/* $NetBSD: uvm_fault.c,v 1.166.2.16 2010/07/12 06:25:14 uebayasi Exp $ */
/*
*
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.15 2010/07/12 02:28:33 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.16 2010/07/12 06:25:14 uebayasi Exp $");
#include "opt_uvmhist.h"
#include "opt_xip.h"
@@ -1767,6 +1767,12 @@
uvm_pageenqueue(pg);
mutex_exit(&uvm_pageqlock);
+uvm_fault_lower_neighbor_enter:
+ UVMHIST_LOG(maphist,
+ " MAPPING: n obj: pm=0x%x, va=0x%x, pg=0x%x",
+ ufi->orig_map->pmap, currva, pg, 0);
+ uvmexp.fltnomap++;
+
/*
* Since this page isn't the page that's actually faulting,
* ignore pmap_enter() failures; it's not critical that we
@@ -1780,15 +1786,9 @@
KASSERT(!UVM_OBJ_IS_CLEAN(pg->uobject) ||
(pg->flags & PG_CLEAN) != 0);
-uvm_fault_lower_neighbor_enter:
pg->flags &= ~(PG_BUSY);
UVM_PAGE_OWN(pg, NULL);
- UVMHIST_LOG(maphist,
- " MAPPING: n obj: pm=0x%x, va=0x%x, pg=0x%x",
- ufi->orig_map->pmap, currva, pg, 0);
- uvmexp.fltnomap++;
-
(void) pmap_enter(ufi->orig_map->pmap, currva,
VM_PAGE_TO_PHYS(pg),
readonly ? (flt->enter_prot & ~VM_PROT_WRITE) :
@@ -1962,11 +1962,6 @@
pg = uobjpage; /* map in the actual object */
uvmexp.flt_obj++;
- if (uvm_pageisdirect_p(uobjpage)) {
- /* XIP'ed device pages are always read-only */
- goto uvm_fault_lower_direct_done;
- }
-
if (UVM_ET_ISCOPYONWRITE(ufi->entry) ||
UVM_OBJ_NEEDS_WRITEFAULT(uobjpage->uobject))
flt->enter_prot &= ~VM_PROT_WRITE;
@@ -1983,7 +1978,6 @@
}
KASSERT(pg == uobjpage);
-uvm_fault_lower_direct_done:
return uvm_fault_lower_enter(ufi, flt, uobj, NULL, pg, uobjpage);
}
@@ -2180,11 +2174,6 @@
pg->flags & PG_RDONLY ? flt->enter_prot & ~VM_PROT_WRITE : flt->enter_prot,
flt->access_type | PMAP_CANFAIL | (flt->wire_mapping ? PMAP_WIRED : 0)) != 0) {
- if (uvm_pageisdirect_p(pg)) {
- /* Device pages never involve paging activity. */
- goto uvm_fault_lower_enter_error_done;
- }
-
/*
* No need to undo what we did; we can simply think of
* this as the pmap throwing away the mapping information.
@@ -2202,7 +2191,6 @@
*/
KASSERT((pg->flags & PG_RELEASED) == 0);
-uvm_fault_lower_enter_error_done:
pg->flags &= ~(PG_BUSY|PG_FAKE|PG_WANTED);
UVM_PAGE_OWN(pg, NULL);
diff -r f570cfafa7b0 -r 7320a219eee8 sys/uvm/uvm_loan.c
--- a/sys/uvm/uvm_loan.c Mon Jul 12 02:28:33 2010 +0000
+++ b/sys/uvm/uvm_loan.c Mon Jul 12 06:25:14 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_loan.c,v 1.77.2.2 2010/05/31 13:26:38 uebayasi Exp $ */
+/* $NetBSD: uvm_loan.c,v 1.77.2.3 2010/07/12 06:25:14 uebayasi Exp $ */
/*
*
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.77.2.2 2010/05/31 13:26:38 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.77.2.3 2010/07/12 06:25:14 uebayasi Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -540,10 +540,6 @@
}
if (error)
goto fail;
- if (uvm_pageisdirect_p(pgpp[0])) {
- error = EBUSY;
- goto fail2;
- }
KASSERT(npages > 0);
@@ -610,7 +606,6 @@
fail:
uvm_unloan(origpgpp, ndone, UVM_LOAN_TOPAGE);
-fail2:
return error;
}
@@ -662,7 +657,7 @@
* then we fail the loan.
*/
- if ((error && error != EBUSY) || uvm_pageisdirect_p(pg)) {
+ if (error && error != EBUSY) {
uvmfault_unlockall(ufi, amap, uobj, NULL);
return (-1);
}
diff -r f570cfafa7b0 -r 7320a219eee8 sys/uvm/uvm_object.c
--- a/sys/uvm/uvm_object.c Mon Jul 12 02:28:33 2010 +0000
+++ b/sys/uvm/uvm_object.c Mon Jul 12 06:25:14 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_object.c,v 1.7.2.2 2010/05/31 13:26:38 uebayasi Exp $ */
+/* $NetBSD: uvm_object.c,v 1.7.2.3 2010/07/12 06:25:14 uebayasi Exp $ */
/*
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_object.c,v 1.7.2.2 2010/05/31 13:26:38 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_object.c,v 1.7.2.3 2010/07/12 06:25:14 uebayasi Exp $");
#include "opt_ddb.h"
#include "opt_uvmhist.h"
@@ -85,9 +85,6 @@
mutex_enter(&uobj->vmobjlock);
for (i = 0; i < npages; i++) {
- if (uvm_pageisdirect_p(pgs[i]))
- continue;
-
KASSERT(pgs[i] != NULL);
KASSERT(!(pgs[i]->flags & PG_RELEASED));
diff -r f570cfafa7b0 -r 7320a219eee8 sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c Mon Jul 12 02:28:33 2010 +0000
+++ b/sys/uvm/uvm_page.c Mon Jul 12 06:25:14 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_page.c,v 1.153.2.43 2010/07/09 12:49:21 uebayasi Exp $ */
+/* $NetBSD: uvm_page.c,v 1.153.2.44 2010/07/12 06:25:14 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.43 2010/07/09 12:49:21 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.44 2010/07/12 06:25:14 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_RDONLY | PG_DIRECT | PG_CLEAN;
+ pg->flags |= PG_FAKE | PG_RDONLY | PG_DIRECT | PG_CLEAN;
#ifdef __HAVE_VM_PAGE_MD
VM_MDPAGE_INIT(&pg->mdpage, paddr);
#endif
Home |
Main Index |
Thread Index |
Old Index