summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2022-09-10 20:35:30 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2022-09-10 20:35:30 +0000
commitb2eb2a5e4c4d57cbeea65dabf3d241852d62561f (patch)
treebfaf8e87034a4d90ec5ebff8be4519357b94e273 /sys/uvm
parent377c83dc5717ad0ad4c69daa289e37335389cded (diff)
Remove pmap_collect() when a no-op, define __HAVE_PMAP_COLLECT otherwise.
Use that define to shunt uvm_swapout_threads(), which is a noop when pmap_collect() does nothing. ok mpi@
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_glue.c6
-rw-r--r--sys/uvm/uvm_pdaemon.c4
-rw-r--r--sys/uvm/uvm_pmap.h4
3 files changed, 9 insertions, 5 deletions
diff --git a/sys/uvm/uvm_glue.c b/sys/uvm/uvm_glue.c
index c37b24720c5..9c45bfdb767 100644
--- a/sys/uvm/uvm_glue.c
+++ b/sys/uvm/uvm_glue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_glue.c,v 1.83 2022/03/12 08:11:07 mpi Exp $ */
+/* $OpenBSD: uvm_glue.c,v 1.84 2022/09/10 20:35:29 miod Exp $ */
/* $NetBSD: uvm_glue.c,v 1.44 2001/02/06 19:54:44 eeh Exp $ */
/*
@@ -321,6 +321,8 @@ uvm_init_limits(struct plimit *limit0)
limit0->pl_rlimit[RLIMIT_RSS].rlim_cur = ptoa(uvmexp.free);
}
+#ifdef __HAVE_PMAP_COLLECT
+
#ifdef DEBUG
int enableswap = 1;
int swapdebug = 0;
@@ -414,6 +416,8 @@ next_process: ;
}
}
+#endif /* __HAVE_PMAP_COLLECT */
+
/*
* uvm_atopg: convert KVAs back to their page structures.
*/
diff --git a/sys/uvm/uvm_pdaemon.c b/sys/uvm/uvm_pdaemon.c
index 350f95edb6b..eeee53330cc 100644
--- a/sys/uvm/uvm_pdaemon.c
+++ b/sys/uvm/uvm_pdaemon.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_pdaemon.c,v 1.104 2022/08/31 09:26:04 mpi Exp $ */
+/* $OpenBSD: uvm_pdaemon.c,v 1.105 2022/09/10 20:35:29 miod Exp $ */
/* $NetBSD: uvm_pdaemon.c,v 1.23 2000/08/20 10:24:14 bjh21 Exp $ */
/*
@@ -890,7 +890,7 @@ uvmpd_scan(struct uvm_pmalloc *pma)
*/
free = uvmexp.free - BUFPAGES_DEFICIT;
-#ifndef __SWAP_BROKEN
+#ifdef __HAVE_PMAP_COLLECT
/*
* swap out some processes if we are below our free target.
* we need to unlock the page queues for this.
diff --git a/sys/uvm/uvm_pmap.h b/sys/uvm/uvm_pmap.h
index e971573c5f1..88bcc0d6fdc 100644
--- a/sys/uvm/uvm_pmap.h
+++ b/sys/uvm/uvm_pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_pmap.h,v 1.30 2022/08/07 19:39:25 miod Exp $ */
+/* $OpenBSD: uvm_pmap.h,v 1.31 2022/09/10 20:35:29 miod Exp $ */
/* $NetBSD: uvm_pmap.h,v 1.1 2000/06/27 09:00:14 mrg Exp $ */
/*
@@ -126,7 +126,7 @@ boolean_t pmap_clear_modify(struct vm_page *);
boolean_t pmap_clear_reference(struct vm_page *);
#endif
-#if !defined(pmap_collect)
+#if !defined(pmap_collect) && defined(__HAVE_PMAP_COLLECT)
void pmap_collect(pmap_t);
#endif
#if !defined(pmap_copy)