uvm_anon_release() is always called for anon that have an associated page so
decrementing `uvmexp.swpgonly' is incorrect. This happened because the page
was cleared before calling uvm_anfree().
Reported by many including mvs@, miod@ and robert@
ok kettenis@, miod@
-/* $OpenBSD: uvm_anon.c,v 1.57 2023/10/27 19:13:51 mpi Exp $ */
+/* $OpenBSD: uvm_anon.c,v 1.58 2024/04/06 10:59:52 mpi Exp $ */
/* $NetBSD: uvm_anon.c,v 1.10 2000/11/25 06:27:59 chs Exp $ */
/*
uvm_unlock_pageq();
KASSERT(anon->an_page == NULL);
lock = anon->an_lock;
- uvm_anfree(anon);
+ uvm_anon_dropswap(anon);
+ pool_put(&uvm_anon_pool, anon);
rw_exit(lock);
/* Note: extra reference is held for PG_RELEASED case. */
rw_obj_free(lock);