From: mpi Date: Thu, 10 Mar 2022 10:46:56 +0000 (+0000) Subject: Do not clear the PG_BUSY flag before passing the anon to uvm_anon_release(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1340df41e0c476cd0cf3ce3ec2af61bd95845302;p=openbsd Do not clear the PG_BUSY flag before passing the anon to uvm_anon_release(). Should prevent a KASSERT() from tiggering when freeing an anon after swaping-out its memory. This code path has been broken since at least January 2021 and is apparently not so easy to trigger. Found the hard way by sthen@ ok kettenis@, kn@ --- diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c index df40cd97395..57b7a52b426 100644 --- a/sys/uvm/uvm_page.c +++ b/sys/uvm/uvm_page.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_page.c,v 1.161 2022/01/19 02:08:24 mpi Exp $ */ +/* $OpenBSD: uvm_page.c,v 1.162 2022/03/10 10:46:56 mpi Exp $ */ /* $NetBSD: uvm_page.c,v 1.44 2000/11/27 08:40:04 chs Exp $ */ /* @@ -1086,8 +1086,6 @@ uvm_page_unbusy(struct vm_page **pgs, int npgs) uvm_pagefree(pg); uvm_unlock_pageq(); } else { - atomic_clearbits_int(&pg->pg_flags, PG_BUSY); - UVM_PAGE_OWN(pg, NULL); rw_enter(pg->uanon->an_lock, RW_WRITE); uvm_anon_release(pg->uanon); }