Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Fixed off by one error that broke blink disable in cgroup. (#620)
Browse files Browse the repository at this point in the history
* Fixed off by one error that broke blink disable in cgroup.

* Added a test for core blinking.
  • Loading branch information
mew2057 authored and John Dunham committed Mar 22, 2019
1 parent 8df98e5 commit 9012ae9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions csmd/src/daemon/src/csmi_request_handler/helpers/cgroup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1726,12 +1726,12 @@ void CGroup::GetCoreIsolation( int64_t cores, std::string &sysCores, std::string
{
thread =
( socket * coresPerSocket * threadsPerCoreMax ) + (core * threadsPerCoreMax ) ;
int32_t extra_thread = thread + + ( threadsPerCoreMax - 1 );
int32_t extra_thread = thread + ( threadsPerCoreMax - 1 );

int32_t cpu = 0;
for(; cpu < threadsPerCore; ++cpu ) sysCores.append(std::to_string(thread++)).append(",");

for( cpu = threadsPerCoreMax; cpu >= blinkOffset && extra_thread > 0; --cpu )
for( cpu = threadsPerCoreMax; cpu > blinkOffset && extra_thread > 0; --cpu )
CPUPower(extra_thread--, CPU_OFFLINE);
}
}
Expand Down Expand Up @@ -1778,8 +1778,8 @@ void CGroup::GetCoreIsolation( int64_t cores, std::string &sysCores, std::string
// ================================================================================

// Blink the first thread, as it's always guaranteed to exist, to prevent process bunching
// in failure cases.
if ( threadBlinkFailure )
// in failure cases. Also only blink if blinking is enabled.
if ( threadBlinkFailure && jitterInfo.GetCoreBlink() )
{
CPUPower( 0, CPU_OFFLINE );
CPUPower( 0, CPU_ONLINE );
Expand Down

0 comments on commit 9012ae9

Please sign in to comment.