diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-07-22 21:05:38 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-07-22 21:05:38 +0000 |
commit | 507033cedbc4148bb3b909524dfb32de4c3193b4 (patch) | |
tree | 3d5a3f6000b05832961b7d8f948faeb41c1c39c6 /sys/uvm/uvm_pdaemon.c | |
parent | efd6f207b9899daa311ce5273c5bc3a538f7a67b (diff) |
Put the PG_RELEASED changes diff back in.
This has has been tested very very thoroughly on all archs we have
excepting 88k and 68k. Please see cvs log for the individual commit
messages.
ok beck@, thib@
Diffstat (limited to 'sys/uvm/uvm_pdaemon.c')
-rw-r--r-- | sys/uvm/uvm_pdaemon.c | 51 |
1 files changed, 18 insertions, 33 deletions
diff --git a/sys/uvm/uvm_pdaemon.c b/sys/uvm/uvm_pdaemon.c index e16ae26ea3b..046368e697a 100644 --- a/sys/uvm/uvm_pdaemon.c +++ b/sys/uvm/uvm_pdaemon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_pdaemon.c,v 1.51 2009/06/26 20:26:02 oga Exp $ */ +/* $OpenBSD: uvm_pdaemon.c,v 1.52 2009/07/22 21:05:37 oga Exp $ */ /* $NetBSD: uvm_pdaemon.c,v 1.23 2000/08/20 10:24:14 bjh21 Exp $ */ /* @@ -820,40 +820,25 @@ 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, - * also zero out anon so we don't use - * it after the free. - */ - anon->an_page = NULL; - p->uanon = 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, + * also zero out anon so we don't use + * it after the free. + */ + anon->an_page = NULL; + p->uanon = 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); |