void
resource_sys_init(void)
{
+ #ifdef CONFIG_DISABLE_THP
+ /* Disable transparent huge pages, they do not work properly with madvice(MADV_DONTNEED) */
+ if (prctl(PR_SET_THP_DISABLE, (unsigned long) 1, (unsigned long) 0, (unsigned long) 0, (unsigned long) 0) < 0)
+ die("prctl(PR_SET_THP_DISABLE) failed: %m");
+ #endif
+
#ifdef HAVE_MMAP
- ASSERT_DIE(global_free_pages.cnt == 0);
-
/* Check what page size the system supports */
if (!(page_size = sysconf(_SC_PAGESIZE)))
die("System page size must be non-zero");