CPU Numbering on a hypertheading enabled system CPU Numbering on a hypertheading enabled system windows windows

CPU Numbering on a hypertheading enabled system


From what I know, it depends on how the CPU exposes his cores. When HT is enabled, there are no exposed physical CPUs, but rather two logical CPUs per physical CPU, so there is no difference if you run a thread on either logical CPU. The only thing that does matter is what pairs of logical CPUs belong to each physical CPU.

With single core processors (like the Pentium 4 with HT), it's pretty straight forward, since you only have one pair - so it's (0, 1). With quad core processors (like Nehalem), the logical cores pairs are (0,4), (1,5), (2,6) and (3,7). The pattern of having all the first halves of each pair then having all the second halves shuold scale with future CPUs that have even more cores.

The real question is why do you need to know the pair arrangement? Let the OS's scheduler pick the right cores for the right threads - it does a pretty decent job.


You can look in /sys/devices/system/cpu/ to find the information about the CPUs. The layout of the cores and their hyperthreaded pairs can be found in /sys/devices/system/cpu/cpuN/topology/thread_siblings_list.