From eec7b0d95f3da11d8adde0e0b31a2090a4e915cf Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Sun, 18 Feb 2018 14:45:51 -0800 Subject: [PATCH] Stop writing the jit_mature_sec log entry Summary: Jit maturity is logged in other places, which gives more information. Reviewed By: paulbiss Differential Revision: D7021740 fbshipit-source-id: 31a40ce895ad7a36eb763168edd694f38366b96c --- hphp/runtime/base/runtime-option.h | 2 +- hphp/runtime/vm/jit/tc-record.cpp | 20 +++----------------- hphp/runtime/vm/jit/tc-record.h | 2 +- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/hphp/runtime/base/runtime-option.h b/hphp/runtime/base/runtime-option.h index 701ba75db0858..b0a4ae3b33424 100644 --- a/hphp/runtime/base/runtime-option.h +++ b/hphp/runtime/base/runtime-option.h @@ -473,7 +473,7 @@ struct RuntimeOption { F(bool, JitEvaledCode, true) \ F(bool, JitRequireWriteLease, false) \ F(uint64_t, JitRelocationSize, kJitRelocationSizeDefault) \ - F(uint64_t, JitMatureSize, 25 << 20) \ + F(uint64_t, JitMatureSize, 125 << 20) \ F(bool, JitMatureAfterWarmup, true) \ F(double, JitMaturityExponent, 1.) \ F(bool, JitTimer, kJitTimerDefault) \ diff --git a/hphp/runtime/vm/jit/tc-record.cpp b/hphp/runtime/vm/jit/tc-record.cpp index f90fb7fc652d2..c4babd7cf927b 100644 --- a/hphp/runtime/vm/jit/tc-record.cpp +++ b/hphp/runtime/vm/jit/tc-record.cpp @@ -106,8 +106,6 @@ void recordBCInstr(uint32_t op, const TCA addr, const TCA end, bool cold) { //////////////////////////////////////////////////////////////////////////////// -static std::atomic s_loggedJitMature{false}; - std::map buildCodeSizeCounters() { std::map counters; @@ -151,7 +149,8 @@ static ServiceData::CounterCallback s_warmedUpCounter( void reportJitMaturity() { auto static jitMaturityCounter = ServiceData::createCounter("jit.maturity"); if (!jitMaturityCounter) return; - if (jitMaturityCounter->getValue() == 100) return; + auto const before = jitMaturityCounter->getValue(); + if (before == 100) return; // Optimized translations are faster than profiling translations, which are // faster than the interpreter. But when optimized translations are // generated, some profiling translations will become dead. We assume the @@ -163,10 +162,7 @@ void reportJitMaturity() { // When retranslateAll is used, we only add ahot after retranslateAll // finishes. if (!mcgen::retranslateAllPending()) codeSize += code().hot().used(); - // EvalJitMatureSize is supposed to to be set to approximately 20% of the - // code that will give us full performance, so recover the "fully mature" - // size with some math. - auto const fullSize = RuntimeOption::EvalJitMatureSize * 5; + auto const fullSize = RuntimeOption::EvalJitMatureSize; // If EvalJitMatureAfterWarmup is set, we consider the JIT to be mature once // warmupStatusString() is empty, which indicates that the JIT is warmed up // based on the rate in which JITed code is being produced. @@ -187,18 +183,8 @@ void reportJitMaturity() { after = 99; } - auto const before = jitMaturityCounter->getValue(); if (after > before) { jitMaturityCounter->setValue(after); - - if (!s_loggedJitMature.load(std::memory_order_relaxed) && - StructuredLog::enabled() && - codeSize >= RuntimeOption::EvalJitMatureSize && - !s_loggedJitMature.exchange(true, std::memory_order_relaxed)) { - StructuredLogEntry cols; - cols.setInt("jit_mature_sec", time(nullptr) - HttpServer::StartTime); - StructuredLog::log("hhvm_warmup", cols); - } } code().forEachBlock([&] (const char* name, const CodeBlock& a) { diff --git a/hphp/runtime/vm/jit/tc-record.h b/hphp/runtime/vm/jit/tc-record.h index f4cf06712ecf2..f5d8ba32db709 100644 --- a/hphp/runtime/vm/jit/tc-record.h +++ b/hphp/runtime/vm/jit/tc-record.h @@ -58,7 +58,7 @@ void recordGdbTranslation(SrcKey sk, const Func* srcFunc, const CodeBlock& cb, void recordBCInstr(uint32_t op, const TCA addr, const TCA end, bool cold); /* - * Report jit warmup statistics to scribe via StructuredLog. + * Update JIT warmup stats and related counters. */ void reportJitMaturity();