summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_pdaemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/uvm/uvm_pdaemon.c')
-rw-r--r--sys/uvm/uvm_pdaemon.c41
1 files changed, 13 insertions, 28 deletions
diff --git a/sys/uvm/uvm_pdaemon.c b/sys/uvm/uvm_pdaemon.c
index e92069c3459..3079110cb1c 100644
--- a/sys/uvm/uvm_pdaemon.c
+++ b/sys/uvm/uvm_pdaemon.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_pdaemon.c,v 1.44 2009/05/08 13:50:15 ariane Exp $ */
+/* $OpenBSD: uvm_pdaemon.c,v 1.45 2009/06/01 19:54:02 oga Exp $ */
/* $NetBSD: uvm_pdaemon.c,v 1.23 2000/08/20 10:24:14 bjh21 Exp $ */
/*
@@ -820,35 +820,20 @@ uvmpd_scan_inactive(struct pglist *pglst)
atomic_clearbits_int(&p->pg_flags, PG_BUSY|PG_WANTED);
UVM_PAGE_OWN(p, NULL);
- /* released during I/O? */
+ /* released during I/O? Can only happen for anons */
if (p->pg_flags & PG_RELEASED) {
- if (anon) {
- /* remove page so we can get nextpg */
- anon->an_page = NULL;
-
- simple_unlock(&anon->an_lock);
- uvm_anfree(anon); /* kills anon */
- pmap_page_protect(p, VM_PROT_NONE);
- anon = NULL;
- uvm_lock_pageq();
- nextpg = TAILQ_NEXT(p, pageq);
- /* free released page */
- uvm_pagefree(p);
-
- } else {
-
- /*
- * pgo_releasepg nukes the page and
- * gets "nextpg" for us. it returns
- * with the page queues locked (when
- * given nextpg ptr).
- */
+ KASSERT(anon != NULL);
+ /* remove page so we can get nextpg */
+ anon->an_page = NULL;
- if (!uobj->pgops->pgo_releasepg(p,
- &nextpg))
- /* uobj died after release */
- uobj = NULL;
- }
+ simple_unlock(&anon->an_lock);
+ uvm_anfree(anon); /* kills anon */
+ pmap_page_protect(p, VM_PROT_NONE);
+ anon = NULL;
+ uvm_lock_pageq();
+ nextpg = TAILQ_NEXT(p, pageq);
+ /* free released page */
+ uvm_pagefree(p);
} else { /* page was not released during I/O */
uvm_lock_pageq();
nextpg = TAILQ_NEXT(p, pageq);