diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2022-06-28 10:45:56 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2022-06-28 10:45:56 +0000 |
commit | 9a7aeafa2a6f078ef0e688394f2145e454616d40 (patch) | |
tree | 4da3dbff96a9f5deefaacc825fc1b42143e81053 /sys | |
parent | 7f9f28a3ff3b0eb8edddb571d503f8dda6db5e97 (diff) |
Do not clean PG_BUSY before calling uvm_anon_release().
Fix an assertion reported by gkoehler@.
ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/uvm/uvm_fault.c | 9 | ||||
-rw-r--r-- | sys/uvm/uvm_pager.c | 8 |
2 files changed, 5 insertions, 12 deletions
diff --git a/sys/uvm/uvm_fault.c b/sys/uvm/uvm_fault.c index ff4fb28f51f..9f5da3ff047 100644 --- a/sys/uvm/uvm_fault.c +++ b/sys/uvm/uvm_fault.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_fault.c,v 1.130 2022/06/28 10:38:55 mpi Exp $ */ +/* $OpenBSD: uvm_fault.c,v 1.131 2022/06/28 10:45:55 mpi Exp $ */ /* $NetBSD: uvm_fault.c,v 1.51 2000/08/06 00:22:53 thorpej Exp $ */ /* @@ -389,10 +389,6 @@ uvmfault_anonget(struct uvm_faultinfo *ufi, struct vm_amap *amap, if (pg->pg_flags & PG_WANTED) { wakeup(pg); } - /* un-busy! */ - atomic_clearbits_int(&pg->pg_flags, - PG_WANTED|PG_BUSY|PG_FAKE); - UVM_PAGE_OWN(pg, NULL); /* * if we were RELEASED during I/O, then our anon is @@ -450,6 +446,9 @@ uvmfault_anonget(struct uvm_faultinfo *ufi, struct vm_amap *amap, uvm_lock_pageq(); uvm_pageactivate(pg); uvm_unlock_pageq(); + atomic_clearbits_int(&pg->pg_flags, + PG_WANTED|PG_BUSY|PG_FAKE); + UVM_PAGE_OWN(pg, NULL); } /* diff --git a/sys/uvm/uvm_pager.c b/sys/uvm/uvm_pager.c index aa1b4ab394e..01d0f8b4307 100644 --- a/sys/uvm/uvm_pager.c +++ b/sys/uvm/uvm_pager.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_pager.c,v 1.78 2022/02/18 09:04:38 kettenis Exp $ */ +/* $OpenBSD: uvm_pager.c,v 1.79 2022/06/28 10:45:55 mpi Exp $ */ /* $NetBSD: uvm_pager.c,v 1.36 2000/11/27 18:26:41 chs Exp $ */ /* @@ -675,14 +675,8 @@ uvm_pager_dropcluster(struct uvm_object *uobj, struct vm_page *pg, /* if page was released, release it. otherwise un-busy it */ if (ppsp[lcv]->pg_flags & PG_RELEASED && ppsp[lcv]->pg_flags & PQ_ANON) { - /* so that anfree will free */ - atomic_clearbits_int(&ppsp[lcv]->pg_flags, - PG_BUSY); - UVM_PAGE_OWN(ppsp[lcv], NULL); - /* kills anon and frees pg */ uvm_anon_release(ppsp[lcv]->uanon); - continue; } else { /* |