git: 2bcbf601a8e2 - stable/13 - jemalloc: use symbolic definitions for bits in vm_overcommit

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Fri, 30 Sep 2022 02:04:08 UTC
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=2bcbf601a8e24471fa4373c40aca222bb438dcf5

commit 2bcbf601a8e24471fa4373c40aca222bb438dcf5
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-09-15 09:59:42 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-09-30 00:29:09 +0000

    jemalloc: use symbolic definitions for bits in vm_overcommit
    
    (cherry picked from commit 87384c51e047349fdbcf4f07fe52d900ce108040)
---
 contrib/jemalloc/src/pages.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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