Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm Record if "promote" is done in UVMHIST. Do it for "...
details: https://anonhg.NetBSD.org/src/rev/9fcf43d705a5
branches: trunk
changeset: 752344:9fcf43d705a5
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Wed Feb 24 04:20:45 2010 +0000
description:
Record if "promote" is done in UVMHIST. Do it for "upper" fault too.
diffstat:
sys/uvm/uvm_fault.c | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
diffs (99 lines):
diff -r 5f3826cdf55d -r 9fcf43d705a5 sys/uvm/uvm_fault.c
--- a/sys/uvm/uvm_fault.c Wed Feb 24 04:18:09 2010 +0000
+++ b/sys/uvm/uvm_fault.c Wed Feb 24 04:20:45 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_fault.c,v 1.167 2010/02/24 04:18:09 uebayasi Exp $ */
+/* $NetBSD: uvm_fault.c,v 1.168 2010/02/24 04:20:45 uebayasi Exp $ */
/*
*
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.167 2010/02/24 04:18:09 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.168 2010/02/24 04:20:45 uebayasi Exp $");
#include "opt_uvmhist.h"
@@ -704,6 +704,7 @@
bool wire_paging;
bool maxprot;
bool cow_now;
+ bool promote;
};
static inline int uvm_fault_check(
@@ -912,6 +913,8 @@
flt->cow_now = (flt->access_type & VM_PROT_WRITE) != 0;
}
+ flt->promote = false;
+
/*
* handle "needs_copy" case. if we need to copy the amap we will
* have to drop our readlock and relock it with a write lock. (we
@@ -1437,6 +1440,7 @@
*/
if (flt->cow_now && anon->an_ref > 1) {
+ flt->promote = true;
error = uvm_fault_upper_promote(ufi, flt, uobj, anon);
} else {
error = uvm_fault_upper_direct(ufi, flt, uobj, anon);
@@ -1568,8 +1572,8 @@
* now map the page in.
*/
- UVMHIST_LOG(maphist, " MAPPING: anon: pm=0x%x, va=0x%x, pg=0x%x",
- ufi->orig_map->pmap, ufi->orig_rvaddr, pg, 0);
+ UVMHIST_LOG(maphist, " MAPPING: anon: pm=0x%x, va=0x%x, pg=0x%x, promote=%d",
+ ufi->orig_map->pmap, ufi->orig_rvaddr, pg, flt->promote);
if (pmap_enter(ufi->orig_map->pmap, ufi->orig_rvaddr, VM_PAGE_TO_PHYS(pg),
flt->enter_prot, flt->access_type | PMAP_CANFAIL | (flt->wire_mapping ? PMAP_WIRED : 0))
!= 0) {
@@ -1648,7 +1652,6 @@
#ifdef DIAGNOSTIC
struct vm_amap * const amap = ufi->entry->aref.ar_amap;
#endif
- bool promote;
int error;
UVMHIST_FUNC("uvm_fault_lower1"); UVMHIST_CALLED(maphist);
@@ -1673,13 +1676,13 @@
if (uobj == NULL) {
uobjpage = PGO_DONTCARE;
- promote = true; /* always need anon here */
+ flt->promote = true; /* always need anon here */
} else {
KASSERT(uobjpage != PGO_DONTCARE);
- promote = flt->cow_now && UVM_ET_ISCOPYONWRITE(ufi->entry);
+ flt->promote = flt->cow_now && UVM_ET_ISCOPYONWRITE(ufi->entry);
}
UVMHIST_LOG(maphist, " case 2 fault: promote=%d, zfill=%d",
- promote, (uobj == NULL), 0,0);
+ flt->promote, (uobj == NULL), 0,0);
/*
* if uobjpage is not null then we do not need to do I/O to get the
@@ -1719,7 +1722,7 @@
KASSERT(uobj == NULL || !UVM_OBJ_IS_CLEAN(uobjpage->uobject) ||
(uobjpage->flags & PG_CLEAN) != 0);
- if (promote == false) {
+ if (flt->promote == false) {
error = uvm_fault_lower_direct(ufi, flt, uobj, uobjpage);
} else {
error = uvm_fault_lower_promote(ufi, flt, uobj, uobjpage);
@@ -2050,8 +2053,8 @@
*/
UVMHIST_LOG(maphist,
- " MAPPING: case2: pm=0x%x, va=0x%x, pg=0x%x, promote=XXX",
- ufi->orig_map->pmap, ufi->orig_rvaddr, pg, 0);
+ " MAPPING: case2: pm=0x%x, va=0x%x, pg=0x%x, promote=%d",
+ ufi->orig_map->pmap, ufi->orig_rvaddr, pg, flt->promote);
KASSERT((flt->access_type & VM_PROT_WRITE) == 0 ||
(pg->flags & PG_RDONLY) == 0);
if (pmap_enter(ufi->orig_map->pmap, ufi->orig_rvaddr, VM_PAGE_TO_PHYS(pg),
Home |
Main Index |
Thread Index |
Old Index