pcm: allow core 0 to be offlined#957
Merged
rdementi merged 1 commit intointel:masterfrom Jun 16, 2025
Merged
Conversation
70d8242 to
ce7b97d
Compare
opcm
requested changes
Jun 16, 2025
Contributor
opcm
left a comment
There was a problem hiding this comment.
thanks. Please address the remaining issue
src/cpucounters.cpp
Outdated
| std::unordered_map<int, domain> topologyDomainMap; | ||
| { | ||
| TemporalThreadAffinity aff0(0); | ||
| const int32 maxTopoDomainAff = 8; |
Contributor
There was a problem hiding this comment.
this will fail if the first 8 cores are offlined which is a realistic scenario. Please increase the max to 1<<16
opcm
approved these changes
Jun 16, 2025
rdementi
approved these changes
Jun 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On servers with Intel SST-PP enabled, it seems core 0 can be put offline, and pcm will fail to start. I corrected
ref_corefrom hardcoded0to usesocketRefCore, and relaxed thread affinityaff0requirement during system topology discovery, now it works on my test environment.Before:
$sudo ./pcm ===== Processor information ===== Linux arch_perfmon flag : yes Hybrid processor : no IBRS and IBPB supported : yes STIBP supported : yes Spec arch caps supported : yes Max CPUID level : 36 CPU family : 6 CPU model number : 173 ERROR: pthread_setaffinity_np for core 0 failed with code 22 PCM ERROR. Exception pthread_setaffinity_np failedAfter:
$sudo ./pcm ===== Processor information ===== Linux arch_perfmon flag : yes Hybrid processor : no IBRS and IBPB supported : yes STIBP supported : yes Spec arch caps supported : yes Max CPUID level : 36 CPU family : 6 CPU model number : 173 Number of logical cores: 240 .... Core (SKT) | UTIL | IPC | CFREQ | L3MISS | L2MISS | L3HIT | L2HIT | L3MPI | L2MPI | L3OCC | LMB | RMB | TEMP 2 0 0.14 0.17 ... 3 0 0.01 0.29 ... 5 0 0.00 0.18 ... 6 0 0.00 0.17 ... 8 0 0.00 0.22 ... 9 0 0.00 0.29 ...