Implement process_madvise support.

Add opt.process_madvise_max_batch which determines if process_madvise is enabled
(non-zero) and the max # of regions in each batch.  Added another limiting
factor which is the space to reserve on stack, which results in the max batch of
128.
This commit is contained in:
Qi Wang 2025-02-04 18:31:11 -08:00 committed by Qi Wang
parent 70f019cd3a
commit 22440a0207
13 changed files with 204 additions and 6 deletions

View file

@ -2544,6 +2544,17 @@ if test "x${je_cv_madvise}" = "xyes" ; then
if test "x${je_cv_madv_collapse}" = "xyes" ; then
AC_DEFINE([JEMALLOC_HAVE_MADVISE_COLLAPSE], [ ], [ ])
fi
dnl Check for process_madvise
JE_COMPILABLE([process_madvise(2)], [
#include <sys/mman.h>
#include <sys/syscall.h>
], [
syscall(SYS_process_madvise, 0, (void *)0, 0, 0, 0);
], [je_cv_process_madvise])
if test "x${je_cv_process_madvise}" = "xyes" ; then
AC_DEFINE([JEMALLOC_HAVE_PROCESS_MADVISE], [ ], [ ])
fi
else
dnl Check for posix_madvise.
JE_COMPILABLE([posix_madvise], [