4

This question already has an answer here:

I'm currently looking at a system where I don't understand how the core IDs are assigned by the Linux kernel.

Some info on the system -

@mySystem~]$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 24
On-line CPU(s) list: 0-23
Thread(s) per core: 1
Core(s) per socket: 12
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Gold 6126 CPU @ 2.60GHz
Stepping: 4
CPU MHz: 2600.000
BogoMIPS: 5200.00
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 1024K
L3 cache: 19712K
NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22
NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23

The system has 12 cores per socket and 2 sockets and no hyperthreading. I see that all the cores are listed as online in /sys/devices/system/cpu/cpu*/online. However, when I look at /proc/cpuinfo, the core IDs do not have a consistent relationship with socket IDs.

> cat ~/proc/cpuinfo | grep -e "processor" -e "core id" -e "physical id" | paste - - -
processor   : 0     physical id : 0     core id     : 0
processor   : 1     physical id : 1     core id     : 0
processor   : 2     physical id : 0     core id     : 6
processor   : 3     physical id : 1     core id     : 6
processor   : 4     physical id : 0     core id     : 1
processor   : 5     physical id : 1     core id     : 1
processor   : 6     physical id : 0     core id     : 5
processor   : 7     physical id : 1     core id     : 4
processor   : 8     physical id : 0     core id     : 2
processor   : 9     physical id : 1     core id     : 3
processor   : 10    physical id : 0     core id     : 4
processor   : 11    physical id : 1     core id     : 14
processor   : 12    physical id : 0     core id     : 3
processor   : 13    physical id : 1     core id     : 8
processor   : 14    physical id : 0     core id     : 13
processor   : 15    physical id : 1     core id     : 13
processor   : 16    physical id : 0     core id     : 8
processor   : 17    physical id : 1     core id     : 9
processor   : 18    physical id : 0     core id     : 12
processor   : 19    physical id : 1     core id     : 12
processor   : 20    physical id : 0     core id     : 9
processor   : 21    physical id : 1     core id     : 10
processor   : 22    physical id : 0     core id     : 11
processor   : 23    physical id : 1     core id     : 11

Here, we see that for physical IDs 0 and 1, we do not have a matching pair of core IDs. for Eg: core ID 5 is associated ONLY with physical ID 0 and core ID 14 is associated ONLY with physical ID 1, and core ID 7 is completely missing.

My question is: Is this a valid configuration assigned by the linux kernel? If so, what is the explanation behind this "anomaly"?

EDIT: I understand that the firmware is in charge of assigning core IDs and it may not be sequential. What I am unclear with is why each physical ID has a different list of core IDs under them. If we have a 16 CPU system (8 cores and 2 sockets) we have core ids from 0-7 for each of the physical ids 0 & 1. However, in my case that does not seem to be respected.

marked as duplicate by slm linux Jul 9 '18 at 20:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.