This makes all code paths deactivating or freeing anons consistent.
No objection from the usual suspects.
-/* $OpenBSD: uvm_anon.c,v 1.55 2023/04/11 00:45:09 jsg Exp $ */
+/* $OpenBSD: uvm_anon.c,v 1.56 2023/09/02 08:24:40 mpi Exp $ */
/* $NetBSD: uvm_anon.c,v 1.10 2000/11/25 06:27:59 chs Exp $ */
/*
KASSERT(anon->an_ref == 0);
uvm_lock_pageq();
+ pmap_page_protect(pg, PROT_NONE);
uvm_pagefree(pg);
uvm_unlock_pageq();
KASSERT(anon->an_page == NULL);
-/* $OpenBSD: uvm_fault.c,v 1.133 2022/11/04 09:36:44 mpi Exp $ */
+/* $OpenBSD: uvm_fault.c,v 1.134 2023/09/02 08:24:40 mpi Exp $ */
/* $NetBSD: uvm_fault.c,v 1.51 2000/08/06 00:22:53 thorpej Exp $ */
/*
* anon and try again.
*/
if (pg->pg_flags & PG_RELEASED) {
- pmap_page_protect(pg, PROT_NONE);
KASSERT(anon->an_ref == 0);
/*
* Released while we had unlocked amap.