]> granicus.if.org Git - php/commitdiff
Disable huge pages in the Zend allocator by default
authorRasmus Lerdorf <rasmus@lerdorf.com>
Tue, 22 Mar 2016 15:04:53 +0000 (08:04 -0700)
committerAnatol Belski <ab@php.net>
Wed, 23 Mar 2016 11:23:35 +0000 (12:23 +0100)
As per the discussion on internals, this is an expert feature
that needs special system-level configuration and care.

Zend/zend_alloc.c

index 4cf1178c570089d54aabd250f22e9c9648d765a7..18765593174f613f3ba29b1edab4301be449b31f 100644 (file)
@@ -201,7 +201,7 @@ typedef struct  _zend_mm_huge_list zend_mm_huge_list;
 #endif
 
 #ifdef MAP_HUGETLB
-int zend_mm_use_huge_pages = 1;
+int zend_mm_use_huge_pages = 0;
 #endif
 
 /*
@@ -2654,8 +2654,8 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
 #endif
 #ifdef MAP_HUGETLB
        tmp = getenv("USE_ZEND_ALLOC_HUGE_PAGES");
-       if (tmp && !zend_atoi(tmp, 0)) {
-               zend_mm_use_huge_pages = 0;
+       if (tmp && zend_atoi(tmp, 0)) {
+               zend_mm_use_huge_pages = 1;
        }
 #endif
        ZEND_TSRMLS_CACHE_UPDATE();