From 61ec4d1ee03eed4fcf61a9716e6b11e0dfd05f63 Mon Sep 17 00:00:00 2001 From: Guilherme Ottoni Date: Tue, 21 May 2019 17:43:11 -0700 Subject: [PATCH] Don't hugify the main and cold code areas beyond their sizes Reviewed By: binliu19 Differential Revision: D15439407 fbshipit-source-id: aad30cba65c313d3a13261e6258bde95de219eac --- hphp/runtime/vm/jit/code-cache.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hphp/runtime/vm/jit/code-cache.cpp b/hphp/runtime/vm/jit/code-cache.cpp index b85650bf5a2..87ced1b6e67 100644 --- a/hphp/runtime/vm/jit/code-cache.cpp +++ b/hphp/runtime/vm/jit/code-cache.cpp @@ -221,16 +221,18 @@ CodeCache::CodeCache() if (kAHotSize) { FTRACE(1, "init ahot @{}, size = {}\n", base, kAHotSize); m_hot.init(base, kAHotSize, "hot"); - const uint32_t hugeMBs = std::min(CodeCache::TCNumHugeHotMB, - uint32_t(kAHotSize >> 20)); - enhugen(base, hugeMBs); + const uint32_t hugeHotMBs = std::min(CodeCache::TCNumHugeHotMB, + uint32_t(kAHotSize >> 20)); + enhugen(base, hugeHotMBs); base += kAHotSize; } TRACE(1, "init a @%p\n", base); m_main.init(base, kASize, "main"); - enhugen(base, CodeCache::TCNumHugeMainMB); + const uint32_t hugeMainMBs = std::min(CodeCache::TCNumHugeMainMB, + uint32_t(kASize >> 20)); + enhugen(base, hugeMainMBs); base += kASize; TRACE(1, "init aprof @%p\n", base); @@ -239,7 +241,9 @@ CodeCache::CodeCache() TRACE(1, "init acold @%p\n", base); m_cold.init(base, kAColdSize, "cold"); - enhugen(base, CodeCache::TCNumHugeColdMB); + const uint32_t hugeColdMBs = std::min(CodeCache::TCNumHugeColdMB, + uint32_t(kAColdSize >> 20)); + enhugen(base, hugeColdMBs); base += kAColdSize; TRACE(1, "init thread_local @%p\n", base); -- 2.11.4.GIT