summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_fault.c
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-06-01 19:54:03 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-06-01 19:54:03 +0000
commitf8d7e4725bdfb323dc5095eb2d8e80a36d63a496 (patch)
treebb29916c2b175311cd9f31dc72f34dbff9affc44 /sys/uvm/uvm_fault.c
parent4e5208a438b355025e66c603943140401434cd55 (diff)
Since we've now cleared up a lot of the PG_RELEASED setting, remove the
pgo_releasepg() hook and just free the page the "normal" way in the one place we'll ever see PG_RELEASED and should care (uvm_page_unbusy, called in aiodoned). ok art@, beck@, thib@
Diffstat (limited to 'sys/uvm/uvm_fault.c')
-rw-r--r--sys/uvm/uvm_fault.c57
1 files changed, 14 insertions, 43 deletions
diff --git a/sys/uvm/uvm_fault.c b/sys/uvm/uvm_fault.c
index a596ef1d342..e9b26c9f9bc 100644
--- a/sys/uvm/uvm_fault.c
+++ b/sys/uvm/uvm_fault.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_fault.c,v 1.53 2009/05/08 13:50:15 ariane Exp $ */
+/* $OpenBSD: uvm_fault.c,v 1.54 2009/06/01 19:54:02 oga Exp $ */
/* $NetBSD: uvm_fault.c,v 1.51 2000/08/06 00:22:53 thorpej Exp $ */
/*
@@ -921,10 +921,10 @@ ReFault:
/*
* if center page is resident and not
- * PG_BUSY|PG_RELEASED then pgo_get
- * made it PG_BUSY for us and gave
- * us a handle to it. remember this
- * page as "uobjpage." (for later use).
+ * PG_BUSY, then pgo_get made it PG_BUSY
+ * for us and gave us a handle to it.
+ * remember this page as "uobjpage."
+ * (for later use).
*/
if (lcv == centeridx) {
@@ -966,8 +966,8 @@ ReFault:
(wired ? PMAP_WIRED : 0));
/*
- * NOTE: page can't be PG_WANTED or PG_RELEASED
- * because we've held the lock the whole time
+ * NOTE: page can't be PG_WANTED because
+ * we've held the lock the whole time
* we've had the handle.
*/
@@ -1371,15 +1371,12 @@ Case2:
/* locked(!locked): uobj, uobjpage */
/*
- * verify that the page has not be released and re-verify
- * that amap slot is still free. if there is a problem,
- * we unlock and clean up.
+ * Re-verify that amap slot is still free. if there is
+ * a problem, we unlock and clean up.
*/
- if ((uobjpage->pg_flags & PG_RELEASED) != 0 ||
- (locked && amap &&
- amap_lookup(&ufi.entry->aref,
- ufi.orig_rvaddr - ufi.entry->start))) {
+ if (locked && amap && amap_lookup(&ufi.entry->aref,
+ ufi.orig_rvaddr - ufi.entry->start)) {
if (locked)
uvmfault_unlockall(&ufi, amap, NULL, NULL);
locked = FALSE;
@@ -1398,17 +1395,6 @@ Case2:
/* still holding object lock */
wakeup(uobjpage);
- if (uobjpage->pg_flags & PG_RELEASED) {
- uvmexp.fltpgrele++;
- KASSERT(uobj->pgops->pgo_releasepg != NULL);
-
- /* frees page */
- if (uobj->pgops->pgo_releasepg(uobjpage,NULL))
- /* unlock if still alive */
- simple_unlock(&uobj->vmobjlock);
- goto ReFault;
- }
-
uvm_lock_pageq();
/* make sure it is in queues */
uvm_pageactivate(uobjpage);
@@ -1423,9 +1409,8 @@ Case2:
}
/*
- * we have the data in uobjpage which is PG_BUSY and
- * !PG_RELEASED. we are holding object lock (so the page
- * can't be released on us).
+ * we have the data in uobjpage which is PG_BUSY and we are
+ * holding object lock.
*/
/* locked: maps(read), amap(if !null), uobj, uobjpage */
@@ -1439,8 +1424,6 @@ Case2:
/*
* notes:
* - at this point uobjpage can not be NULL
- * - at this point uobjpage can not be PG_RELEASED (since we checked
- * for it above)
* - at this point uobjpage could be PG_WANTED (handle later)
*/
@@ -1627,9 +1610,7 @@ Case2:
}
/*
- * dispose of uobjpage. it can't be PG_RELEASED
- * since we still hold the object lock.
- * drop handle to uobj as well.
+ * dispose of uobjpage. drop handle to uobj as well.
*/
if (uobjpage->pg_flags & PG_WANTED)
@@ -1692,11 +1673,6 @@ Case2:
if (pg->pg_flags & PG_WANTED)
wakeup(pg); /* lock still held */
- /*
- * note that pg can't be PG_RELEASED since we did not drop
- * the object lock since the last time we checked.
- */
-
atomic_clearbits_int(&pg->pg_flags, PG_BUSY|PG_FAKE|PG_WANTED);
UVM_PAGE_OWN(pg, NULL);
uvmfault_unlockall(&ufi, amap, uobj, NULL);
@@ -1736,11 +1712,6 @@ Case2:
if (pg->pg_flags & PG_WANTED)
wakeup(pg); /* lock still held */
- /*
- * note that pg can't be PG_RELEASED since we did not drop the object
- * lock since the last time we checked.
- */
-
atomic_clearbits_int(&pg->pg_flags, PG_BUSY|PG_FAKE|PG_WANTED);
UVM_PAGE_OWN(pg, NULL);
uvmfault_unlockall(&ufi, amap, uobj, NULL);