tags : Computer Architecture, Operating Systems, Concurrency

VAS for different architectures

vCPUs

You always have at least one core, one die and one package.

NameWhat
PackageWhat you get when you buy a single processor. Contains one or more dies.
DieActual silicon. A die can contain any number of cores
SocketThe physical connector linking the processor to the computer’s motherboard. There can be multiple.
CoreIndependent execution unit that can run one program thread at a time in parallel with other cores.
vCPUvCPUs are compute threads that process execution for running os/vm.

vCPU calculation

  • (# Sockets) * (# Cores) = (# pCPU) (Physical CPU)
  • (# pCPU) * (2 Threads) = (# vCPU) (Virtual CPU)
Thread(s) per core:  2
Core(s) per socket:  4
Socket(s):           1
On-line CPU(s) list:   0-7 (8)

pCPU = 1 * 4 = 4
vCPU = 4*2 = 8

VMs and Hypervisors

Now the term vCPU is widely used in hypervisors etc. In those cases, most hypervisors will let you overprovision cores. That means, you could assign 1 vCPU per VM, but the hypervisors also allow you overcommit every vcpu if you think your workload could handle that.

x86 Microarchitecture levels (march)

  • See x86-64 - Wikipedia
  • See x86 Options (Using the GNU Compiler Collection (GCC))
  • See x86-64 Microarchitecture Feature Levels
  • uops.info
  • We can tell compilers about available instruction-set to optimize for using march flag
  • These features have to be supported by the CPU in the first place. You can search for your CPU at CPU-World and see supported features.
  • Enabled features can be found at cat /proc/cpuinfo
  • You can check supported levels with /lib/ld-linux-x86-64.so.2 --help
      x86-64-v4
      x86-64-v3 (supported, searched)
      x86-64-v2 (supported, searched)
  • The v2-v4 levels are arbitrary names defined by grouping different instruction sets based on their age and usefulness.

x86-64-baseline

  • CMOV, CMPXCHG8B, FPU, FXSR, MMX, FXSR, SCE, SSE, SSE2

x86-64-v2

  • CMPXCHG16B, LAHF-SAHF, POPCNT, SSE3, SSE4.1, SSE4.2, SSSE3
  • close to Nehalem
  • Basically mandatory for modern OS

x86-64-v3

  • AVX, AVX2, BMI1, BMI2, F16C, FMA, LZCNT, MOVBE, XSAVE
  • close to Haswell
  • Nice to haves

x86-64-v4

  • AVX512F, AVX512BW, AVX512CD, AVX512DQ, AVX512VL
  • Cutting edge enterprise feature sets

Word

  • See wordsize w $ getconf WORD_BIT and LONG_BIT (32 on my computer)
  • WORD (16 bits/2 bytes)
  • DWORD (32 bits/4 bytes)
  • QWORD (64 bits/8 bytes)

Registers

Glossary

Chipset

  • Thing that’s in the motherboard that manages the data flow between the processor, memory and peripherals. i.e I/O Bridge.

Others