From f8cbc53adb2e21ab6fdb81d75d0bf0a6aa16df7d Mon Sep 17 00:00:00 2001 From: mpi Date: Tue, 28 Jun 2022 10:45:55 +0000 Subject: [PATCH] Do not clean PG_BUSY before calling uvm_anon_release(). Fix an assertion reported by gkoehler@. ok kettenis@ --- sys/uvm/uvm_fault.c | 9 ++++----- 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 { /* -- 2.20.1