Module Name: src
Committed By: uebayasi
Date: Sat Jan 30 15:13:25 UTC 2010
Modified Files:
src/sys/uvm: uvm_fault.c
Log Message:
Calculate the offset from vm_map_entry's start to vm_page array's start once.
To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/uvm/uvm_fault.c
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_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.130 src/sys/uvm/uvm_fault.c:1.131
--- src/sys/uvm/uvm_fault.c:1.130 Sun Jan 24 15:03:02 2010
+++ src/sys/uvm/uvm_fault.c Sat Jan 30 15:13:25 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_fault.c,v 1.130 2010/01/24 15:03:02 uebayasi Exp $ */
+/* $NetBSD: uvm_fault.c,v 1.131 2010/01/30 15:13:25 uebayasi Exp $ */
/*
*
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.130 2010/01/24 15:03:02 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.131 2010/01/30 15:13:25 uebayasi Exp $");
#include "opt_uvmhist.h"
@@ -872,6 +872,8 @@
centeridx = 0;
}
+ /* offset from entry's start to pgs' start */
+ const voff_t eoff = startva - ufi.entry->start;
/* locked: maps(read) */
UVMHIST_LOG(maphist, " narrow=%d, back=%d, forw=%d, startva=0x%x",
@@ -886,8 +888,7 @@
if (amap) {
amap_lock(amap);
anons = anons_store;
- amap_lookups(&ufi.entry->aref, startva - ufi.entry->start,
- anons, npages);
+ amap_lookups(&ufi.entry->aref, eoff, anons, npages);
} else {
anons = NULL; /* to be safe */
}
@@ -910,7 +911,7 @@
/* flush object? */
if (uobj) {
- uoff = (startva - ufi.entry->start) + ufi.entry->offset;
+ uoff = ufi.entry->offset + eoff;
mutex_enter(&uobj->vmobjlock);
(void) (uobj->pgops->pgo_put)(uobj, uoff, uoff +
(nback << PAGE_SHIFT), PGO_DEACTIVATE);
@@ -1049,8 +1050,7 @@
uvmexp.fltlget++;
gotpages = npages;
- (void) uobj->pgops->pgo_get(uobj, ufi.entry->offset +
- (startva - ufi.entry->start),
+ (void) uobj->pgops->pgo_get(uobj, ufi.entry->offset + eoff,
pages, &gotpages, centeridx,
access_type & MASK(ufi.entry),
ufi.entry->advice, PGO_LOCKED);