summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2023-10-27 19:13:52 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2023-10-27 19:13:52 +0000
commiteccccdeaf777d021e5d8eac0176b6d1f9169c381 (patch)
tree80beaf93780e2b0f9ccce2097769206225c9aba3 /sys
parent9888aa2de4bb521257641be2ee060fd809de2492 (diff)
Do not decrement the swap counter if the anon is associated to a "bad" slot.
When such anon is freed its content is obviously not living in swap. ok miod@
Diffstat (limited to 'sys')
-rw-r--r--sys/uvm/uvm_anon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/uvm/uvm_anon.c b/sys/uvm/uvm_anon.c
index abb3e8de3d8..4c4bf8eef3a 100644
--- a/sys/uvm/uvm_anon.c
+++ b/sys/uvm/uvm_anon.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_anon.c,v 1.56 2023/09/02 08:24:40 mpi Exp $ */
+/* $OpenBSD: uvm_anon.c,v 1.57 2023/10/27 19:13:51 mpi Exp $ */
/* $NetBSD: uvm_anon.c,v 1.10 2000/11/25 06:27:59 chs Exp $ */
/*
@@ -116,7 +116,7 @@ uvm_anfree_list(struct vm_anon *anon, struct pglist *pgl)
uvm_unlock_pageq(); /* free the daemon */
}
} else {
- if (anon->an_swslot != 0) {
+ if (anon->an_swslot != 0 && anon->an_swslot != SWSLOT_BAD) {
/* This page is no longer only in swap. */
KASSERT(uvmexp.swpgonly > 0);
atomic_dec_int(&uvmexp.swpgonly);