Backport of client/fingerprint: correctly fingerprint E/P cores of Apple Silicon chips into release/1.5.x #16690
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.
Backport
This PR is auto-generated from #16672 to be assessed for backporting due to the inclusion of the label backport/1.5.x.
The below text is copied from the body of the original PR.
This PR adds detection of asymetric core types (Power (P) & Efficiency (E))
when running on M1/M2 Apple Silicon CPUs. This functionality is provided
by
shoenig/go-m1cpu
which makes use of the Apple IOKit framework to readundocumented registers containing CPU performance data. Currently working
on getting that functionality merged upstream into
gopsutil
, butgopsutil
would still not support detecting P vs E cores like this PR does.
Also refactors the
CPUFingerprinter
code to handle the mixed coretypes, now setting power vs efficiency cpu attributes.
For now the scheduler is still unaware of mixed core types - on Apple
platforms tasks cannot reserve cores anyway so it doesn't matter, but
at least now the total CPU shares available will be correct.
Future work should include adding support for detecting P/E cores on
the latest and upcoming Intel chips, where computation of total cpu shares
is currently incorrect. For that, we should also include updating the
scheduler to be core-type aware, so that tasks making use of
resources.cores
on Linux platforms can be assigned the correct number of CPU shares for the core
type(s) they have been assigned.
node attributes before
node attributes after
Fixes #12029
Fixes #11046
Fixes #9408