aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2022-09-15 09:59:42 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2022-09-16 20:23:19 +0000
commit87384c51e047349fdbcf4f07fe52d900ce108040 (patch)
treed0c38c0df4efb7e343001518bb67cc70b166e209
parent26eed2aa06a2e523ffd4191ac67818242d5035e7 (diff)
jemalloc: use symbolic definitions for bits in vm_overcommit
Reviewed by: brooks, imp (previous version) Discussed with: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D36540
-rw-r--r--contrib/jemalloc/src/pages.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/jemalloc/src/pages.c b/contrib/jemalloc/src/pages.c
index 13de27a0087d..3600443e2cb5 100644
--- a/contrib/jemalloc/src/pages.c
+++ b/contrib/jemalloc/src/pages.c
@@ -12,6 +12,7 @@
#include <sys/sysctl.h>
#ifdef __FreeBSD__
#include <vm/vm_param.h>
+#include <vm/vm.h>
#endif
#endif
@@ -455,7 +456,10 @@ os_overcommits_sysctl(void) {
}
#endif
- return ((vm_overcommit & 0x3) == 0);
+#ifdef SWAP_RESERVE_FORCE_ON
+ return ((vm_overcommit & (SWAP_RESERVE_FORCE_ON |
+ SWAP_RESERVE_RLIMIT_ON)) == 0);
+#endif
}
#endif