Skip to content

Commit

Permalink
Revert "Merge to 24-3: fix harmonizer logic with hoggish pools (ydb-p…
Browse files Browse the repository at this point in the history
…latform#9477)"

This reverts commit ec98756.
  • Loading branch information
kruall committed Sep 20, 2024
1 parent 7eb941d commit 901cd46
Show file tree
Hide file tree
Showing 11 changed files with 169 additions and 634 deletions.
8 changes: 4 additions & 4 deletions ydb/library/actors/core/executor_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ namespace NActors {
class ISchedulerCookie;

struct TCpuConsumption {
double ElapsedUs = 0;
double CpuUs = 0;
double ConsumedUs = 0;
double BookedUs = 0;
ui64 NotEnoughCpuExecutions = 0;

void Add(const TCpuConsumption& other) {
ElapsedUs += other.ElapsedUs;
CpuUs += other.CpuUs;
ConsumedUs += other.ConsumedUs;
BookedUs += other.BookedUs;
NotEnoughCpuExecutions += other.NotEnoughCpuExecutions;
}
};
Expand Down
10 changes: 5 additions & 5 deletions ydb/library/actors/core/executor_pool_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,10 @@ namespace NActors {
poolStats.DecreasingThreadsByHoggishState = stats.DecreasingThreadsByHoggishState;
poolStats.DecreasingThreadsByExchange = stats.DecreasingThreadsByExchange;
poolStats.PotentialMaxThreadCount = stats.PotentialMaxThreadCount;
poolStats.MaxElapsedCpuUs = stats.MaxElapsedCpu;
poolStats.MinElapsedCpuUs = stats.MinElapsedCpu;
poolStats.MaxCpuUs = stats.MaxCpu;
poolStats.MinCpuUs = stats.MinCpu;
poolStats.MaxConsumedCpuUs = stats.MaxConsumedCpu;
poolStats.MinConsumedCpuUs = stats.MinConsumedCpu;
poolStats.MaxBookedCpuUs = stats.MaxBookedCpu;
poolStats.MinBookedCpuUs = stats.MinBookedCpu;
}

statsCopy.resize(MaxFullThreadCount + 1);
Expand All @@ -430,7 +430,7 @@ namespace NActors {
void TBasicExecutorPool::GetExecutorPoolState(TExecutorPoolState &poolState) const {
if (Harmonizer) {
TPoolHarmonizerStats stats = Harmonizer->GetPoolStats(PoolId);
poolState.UsedCpu = stats.AvgElapsedCpu;
poolState.UsedCpu = stats.AvgConsumedCpu;
poolState.PossibleMaxLimit = stats.PotentialMaxThreadCount;
} else {
poolState.PossibleMaxLimit = poolState.MaxLimit;
Expand Down
4 changes: 2 additions & 2 deletions ydb/library/actors/core/executor_pool_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ namespace NActors {

void TIOExecutorPool::GetCurrentStats(TExecutorPoolStats& poolStats, TVector<TExecutorThreadStats>& statsCopy) const {
poolStats.CurrentThreadCount = PoolThreads;
poolStats.DefaultThreadCount = 0;
poolStats.DefaultThreadCount = PoolThreads;
poolStats.MaxThreadCount = PoolThreads;
poolStats.PotentialMaxThreadCount = PoolThreads;
statsCopy.resize(PoolThreads + 1);
Expand All @@ -156,7 +156,7 @@ namespace NActors {
void TIOExecutorPool::GetExecutorPoolState(TExecutorPoolState &poolState) const {
if (Harmonizer) {
TPoolHarmonizerStats stats = Harmonizer->GetPoolStats(PoolId);
poolState.UsedCpu = stats.AvgElapsedCpu;
poolState.UsedCpu = stats.AvgConsumedCpu;
}
poolState.CurrentLimit = PoolThreads;
poolState.MaxLimit = PoolThreads;
Expand Down
8 changes: 4 additions & 4 deletions ydb/library/actors/core/executor_pool_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,16 @@ void TSharedExecutorPool::GiveHalfThread(i16 from, i16 to) {
}

void TSharedExecutorPool::GetSharedStats(i16 poolId, std::vector<TExecutorThreadStats>& statsCopy) {
statsCopy.resize(SharedThreadCount);
statsCopy.resize(SharedThreadCount + 1);
for (i16 i = 0; i < SharedThreadCount; ++i) {
Threads[i].Thread->GetSharedStats(poolId, statsCopy[i]);
Threads[i].Thread->GetSharedStats(poolId, statsCopy[i + 1]);
}
}

void TSharedExecutorPool::GetSharedStatsForHarmonizer(i16 poolId, std::vector<TExecutorThreadStats>& statsCopy) {
statsCopy.resize(SharedThreadCount);
statsCopy.resize(SharedThreadCount + 1);
for (i16 i = 0; i < SharedThreadCount; ++i) {
Threads[i].Thread->GetSharedStatsForHarmonizer(poolId, statsCopy[i]);
Threads[i].Thread->GetSharedStatsForHarmonizer(poolId, statsCopy[i + 1]);
}
}

Expand Down
Loading

0 comments on commit 901cd46

Please sign in to comment.