How to detect heterogeneous CPU topologies on Linux?

Viewed 34

Many recent CPUs out there--Alder Lake from Intel and many big.LITTLE designs from ARM--have heterogeneous CPU topologies: some cores are faster than others. There exists good ways to detect such CPUs on Windows and macOS, but Linux/Android seems lacking.

On x86, there is a CPUID bit: leaf 7 page 0 EDX bit 15. But ARM's CPUID equivalent is privileged, so OS help is required.

Is there a good way on Linux to detect this?

For posterity:

  • On Windows, use GetLogicalProcessorInformationEx to enumerate packages and cores, then look for .Processor.EfficiencyClass being different values among cores (queries using RelationProcessorCore).
  • On macOS, use sysctlbyname on hw.nperflevels and check whether it exists and its value is greater than 1.
0 Answers
Related