2

I've noticed that CPUs are numbered by Linux according to quite different schemes on different multi-socket NUMA systems.

I mean the CPU numbers you use in kernel parameters such as isolcpus= or when setting the affinity of threads.

You can check the CPU numbering with numactl --hardware or lscpu -e.

Examples: (each system has 2 CPU à 8 cores without hyperthreading)

node 0 cpus: 0 1 2 3 8  9  10 11
node 1 cpus: 4 5 6 7 12 13 14 15

=> seen this with HP, striped with a striping distance of 4

node 0 cpus: 0 2 4 6 8 10 12 14
node 1 cpus: 1 3 5 7 9 11 13 15

=> also with HP, striped with striping distance of 1 - or interleaved - or round-robin

node 0 cpus: 0 1  2  3  4  5  6  7
node 1 cpus: 8 9 10 11 12 13 14 15

=> seen with Supermicro, consecutive numbering, i.e. full stripes with a striping distance of #cores_per_cpu

The last scheme is arguably the 'natural' one. I mean if you have 16 cores in total with 2 sockets why would you want to number them in any different way?

(Having to deal with different schemes obviously complicates things in configuration and application logic.)

Thus my question: Is there a way to tell Linux to always number CPUs in one socket consecutively?

If it isn't possible to configure this in Linux, is there a BIOS option that influences the numbering?

And what are the reasons different vendors use a different numbering scheme (and even change their scheme from generation to generation)?

maxschlepzig
  • 694
  • 5
  • 16
  • Related: [How does the kernel assign cpu ids to physical cores? (UNIX.SE)](https://unix.stackexchange.com/a/281153/1131) – maxschlepzig Apr 13 '20 at 10:37

0 Answers0