diff options
| author | kruall <[email protected]> | 2023-03-14 11:25:06 +0300 |
|---|---|---|
| committer | kruall <[email protected]> | 2023-03-14 11:25:06 +0300 |
| commit | 4dc924fece9830cb2b8c7f447c04b745561af4a6 (patch) | |
| tree | 68f90dc0f3b51efbe663fd85a1582399a97f4d0d /library/cpp/actors/core/harmonizer.cpp | |
| parent | ea643713e962d8ba3084bb62c650717573a54123 (diff) | |
Fix false starving state,
Diffstat (limited to 'library/cpp/actors/core/harmonizer.cpp')
| -rw-r--r-- | library/cpp/actors/core/harmonizer.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/library/cpp/actors/core/harmonizer.cpp b/library/cpp/actors/core/harmonizer.cpp index 17f00f09c6e..1b547a9ad6e 100644 --- a/library/cpp/actors/core/harmonizer.cpp +++ b/library/cpp/actors/core/harmonizer.cpp @@ -170,9 +170,10 @@ double TPoolInfo::GetlastSecondPoolConsumed(i16 threadIdx) { void TPoolInfo::PullStats(ui64 ts) { for (i16 threadIdx = 0; threadIdx < MaxThreadCount; ++threadIdx) { TThreadInfo &threadInfo = ThreadInfo[threadIdx]; - threadInfo.Consumed.Register(ts, Pool->GetThreadConsumedUs(threadIdx)); + TCpuConsumption cpuConsumption = Pool->GetThreadCpuConsumption(threadIdx); + threadInfo.Consumed.Register(ts, cpuConsumption.ConsumedUs); LWPROBE(SavedValues, Pool->PoolId, Pool->GetName(), "consumed", UNROLL_HISTORY(threadInfo.Consumed.History)); - threadInfo.Booked.Register(ts, Pool->GetThreadBookedUs(threadIdx)); + threadInfo.Booked.Register(ts, cpuConsumption.BookedUs); LWPROBE(SavedValues, Pool->PoolId, Pool->GetName(), "booked", UNROLL_HISTORY(threadInfo.Booked.History)); } } @@ -237,7 +238,7 @@ void THarmonizer::PullStats(ui64 ts) { } Y_FORCE_INLINE bool IsStarved(double consumed, double booked) { - return Max(consumed, booked) > 0.1 && consumed < booked * 0.7; + return consumed < booked * 0.7; } Y_FORCE_INLINE bool IsHoggish(double booked, ui16 currentThreadCount) { |
