Skip to content

Commit

Permalink
Stop writing the jit_mature_sec log entry
Browse files Browse the repository at this point in the history
Summary: Jit maturity is logged in other places, which gives more information.

Reviewed By: paulbiss

Differential Revision: D7021740

fbshipit-source-id: 31a40ce895ad7a36eb763168edd694f38366b96c
  • Loading branch information
binliu19 authored and hhvm-bot committed Feb 18, 2018
1 parent f0be109 commit eec7b0d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
2 changes: 1 addition & 1 deletion hphp/runtime/base/runtime-option.h
Expand Up @@ -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) \
Expand Down
20 changes: 3 additions & 17 deletions hphp/runtime/vm/jit/tc-record.cpp
Expand Up @@ -106,8 +106,6 @@ void recordBCInstr(uint32_t op, const TCA addr, const TCA end, bool cold) {

////////////////////////////////////////////////////////////////////////////////

static std::atomic<bool> s_loggedJitMature{false};

std::map<std::string, ServiceData::ExportedTimeSeries*>
buildCodeSizeCounters() {
std::map<std::string, ServiceData::ExportedTimeSeries*> counters;
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion hphp/runtime/vm/jit/tc-record.h
Expand Up @@ -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();

Expand Down

0 comments on commit eec7b0d

Please sign in to comment.