CPU core
Also called Core
A CPU core is a complete processing unit within a CPU, with its own pipeline and execution units. A CPU with many cores runs many programs at the same time instead of switching between them. Each core fetches and runs its own stream of instructions, independent of the others. The cores on one chip still share some parts, such as the last-level cache and the path to memory.
Server processors hold dozens of cores. The operating system sees each core, or each hardware thread on it, as a separate logical processor to schedule work on. Chips gained cores rather than clock speed once faster clocks began to produce more heat than chips could shed. A program gains from more cores only when it splits its work into threads or processes that run at once.
Cores are the unit in which processor capacity is counted and divided. A vCPU is usually one hardware thread of a core, so the way cores are shared shapes both the speed and the isolation of virtual machines. Some providers sell dedicated cores, which no other customer uses. A guest cannot tell from inside whether its vCPUs share cores with another customer, because it sees only the layout the host reports.
Simultaneous multithreading
Simultaneous multithreading, or SMT, is a design in which one core holds the state of several instruction streams, called hardware threads. Most cores that have it run two, and some server architectures run four or eight. The core fills its idle units with work from whichever stream is ready. The threads share the execution units, but each has its own registers and program counter. Switching between the streams costs nothing, because the core keeps every set of state at once.
SMT exists because a single program rarely keeps every part of a core busy. While one instruction waits on memory, the arithmetic units of the core sit idle. Filling those gaps with a second stream raises the work a core finishes per second, without adding much to its size. Caches attack the same waiting from the other side, by making the waits shorter.
Intel sells SMT as Hyper-Threading, and AMD server processors support it too. Many Arm server processors, such as AWS Graviton, leave it out and give each logical processor a whole core. Leaving SMT out makes each logical processor an unshared unit with steady speed, which suits clouds that sell vCPUs. On most x86-64 servers, a firmware setting lets an operator turn SMT off.
| Count | Description |
|---|---|
| Sockets | Sockets are the processor slots on the board, each holding one CPU. |
| Cores per socket | Cores per socket is the number of physical cores in each CPU. |
| Threads per core | Threads per core is usually two with SMT, up to eight on some architectures, and one without it. |
| Logical processors | The logical processor count is sockets times cores per socket times threads per core, so a two-socket server with 64-core SMT processors shows 256 logical processors but has 128 physical cores. |
Sibling threads
Sibling threads are the hardware threads of one core, and they are not separate cores. They share the execution units of the core and its nearest caches. The Linux scheduler knows which logical processors are siblings and treats them differently from separate cores. It spreads busy tasks across separate cores before it doubles up on siblings.
Two busy siblings each run slower than either would alone, and the gain from SMT depends on the workload. Because siblings share so much, one can also learn about the other by timing the shared parts. When both run code that leans on the same units, such as floating-point math, they mostly take turns. A pair of siblings is best counted as somewhat more than one core, not as two.
Flaws such as L1 Terminal Fault and Microarchitectural Data Sampling let one thread read data its sibling had just touched. The leaks worked even across a virtual machine boundary. Both belong to a wave of flaws in speculative execution, in which the processor briefly touches data it should not. Microcode and software fixes closed parts of each, but the only full fix between tenants was to stop the sharing.
Core isolation
Core isolation is the practice of keeping two tenants off the sibling threads of one core. A hypervisor cannot fully close the side channel between siblings in software, so hosts that run code from different owners avoid that sharing. The rule applies to tenants, not to threads, so one tenant's own threads may still share a core. Hosts that run code from a single owner often leave SMT on, since siblings that trust each other have nothing to hide.
Cloud providers that sell a vCPU as one hardware thread usually sell them in sibling pairs, so both threads of a core belong to the same customer. Linux added core scheduling for the same reason. This is why many cloud machine types come only with even numbers of vCPUs. Selling pairs also wastes nothing, since the second thread of each core is billed rather than left idle.
Core scheduling lets the kernel run only mutually trusted tasks on siblings at the same time. The strictest option, turning SMT off, gives up its throughput for a simpler isolation boundary. Tasks that trust each other share a label, and the kernel leaves a sibling idle rather than pair tasks with different labels. That idle time is the cost, and it grows when few tasks with the same label are ready to run.