From bff19560ee234a58064ae6bc4645d29d9e02e5a5 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Tue, 23 Oct 2018 13:54:54 +0000 Subject: [PATCH] Pick 676cdd66792ccb629a978837ea2a066d5db342cc from upstream: Disable runtime detection of lazy purging support on FreeBSD. The check doesn't seem to serve any purpose here, and this shaves off three syscalls on binary startup. Discussed by: jasone MFC after: 2 weeks Sponsored by: DARPA, AFRL --- contrib/jemalloc/src/pages.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/jemalloc/src/pages.c b/contrib/jemalloc/src/pages.c index 26002692d600..8acebd1b818b 100644 --- a/contrib/jemalloc/src/pages.c +++ b/contrib/jemalloc/src/pages.c @@ -588,6 +588,11 @@ pages_boot(void) { init_thp_state(); +#ifdef __FreeBSD__ + /* + * FreeBSD doesn't need the check; madvise(2) is known to work. + */ +#else /* Detect lazy purge runtime support. */ if (pages_can_purge_lazy) { bool committed = false; @@ -601,6 +606,7 @@ pages_boot(void) { } os_pages_unmap(madv_free_page, PAGE); } +#endif return false; }