CPU series, post 3 of 5
The flash was ready. The kernel was not.
By the early 2010s, solid-state drives could complete more I/O operations per second than the Linux block layer could hand them. Bjørling, Axboe and colleagues laid out why in a 2013 SYSTOR paper. The block layer kept one request queue per device, guarded by one lock. Add cores and they line up behind the lock. In the authors’ tests the single-queue design could not sustain more than about one million IOPS, no matter how many cores pushed on it. Their multi-queue redesign, one software queue per core feeding the device’s hardware queues, reached 3.5 million IOPS on a single socket and up to 10 million on an eight-socket machine.

The hardware was parallel. The software was serial. That pattern repeats wherever hardware goes parallel: cores, caches, memory channels, queues.
This post measures it in four places. Cache lines, the serial fraction, memory misses and storage lanes. Each has a program and a result from the same 2-vCPU cloud VM as Posts 1 and 2: Intel Xeon at 2.1 GHz, Linux 6.18. Then it points the arithmetic at two real servers, Lenovo’s ThinkSystem SR650 V4 and SR665 V3, because a lab machine with two cores cannot show what 86 cores and 36 NVMe drives do to each other.
Two threads, two variables, one cache line
Each core owns a private L1 cache and usually a private L2. The L3 is shared. Data moves in 64-byte cache lines on x86, and a coherence protocol keeps every core’s view consistent by passing ownership of a line from core to core. Two threads that update two different variables in the same line share nothing in your source code. The hardware makes them share it anyway. That is false sharing.
The program below runs two threads, each pinned to its own CPU, each doing 30 million atomic increments on its own counter. In the first layout both counters sit in one cache line. In the second, _Alignas(64) puts each counter on a line of its own.
// false_sharing.c: two threads, two atomic counters. One cache line versus two.
#define _GNU_SOURCE
#include <pthread.h>
#include <sched.h>
#include <stdio.h>
#include <time.h>
#define N 30000000L
struct same { long a, b; }; // a and b share a 64-byte line
struct apart { _Alignas(64) long a; _Alignas(64) long b; }; // one line each
static struct same s;
static struct apart p;
struct job { long *ctr; int cpu; };
static void *bump(void *arg) {
struct job *j = arg;
cpu_set_t set;
CPU_ZERO(&set);
CPU_SET(j->cpu, &set);
sched_setaffinity(0, sizeof set, &set);
for (long i = 0; i < N; i++) __atomic_fetch_add(j->ctr, 1, __ATOMIC_RELAXED);
return 0;
}
static double seconds(long *x, long *y) {
struct job a = {x, 0}, b = {y, 1};
pthread_t ta, tb;
struct timespec t0, t1;
clock_gettime(CLOCK_MONOTONIC, &t0);
pthread_create(&ta, 0, bump, &a);
pthread_create(&tb, 0, bump, &b);
pthread_join(ta, 0);
pthread_join(tb, 0);
clock_gettime(CLOCK_MONOTONIC, &t1);
return (t1.tv_sec - t0.tv_sec) + (t1.tv_nsec - t0.tv_nsec) / 1e9;
}
int main(void) {
printf("struct sizes: same-line %zu bytes, padded %zu bytes\n", sizeof s, sizeof p);
for (int r = 1; r <= 3; r++) {
double t_same = seconds(&s.a, &s.b), t_apart = seconds(&p.a, &p.b);
printf("run %d: same line %.2f s, separate lines %.2f s (%.1fx)\n", r, t_same, t_apart, t_same / t_apart);
}
return 0;
}
$ ./false_sharing
struct sizes: same-line 16 bytes, padded 128 bytes
run 1: same line 1.77 s, separate lines 0.24 s (7.4x)
run 2: same line 1.87 s, separate lines 0.19 s (10.1x)
run 3: same line 1.44 s, separate lines 0.17 s (8.7x)
Same instructions, same two counters, same two CPUs. The layout alone cost 7.4x, 10.1x and 8.7x. Per increment that is roughly 48 to 62 nanoseconds with a shared line against 6 to 8 with separate lines, which is the price of moving a line between cores on every operation. The padded struct is 128 bytes to buy 8. That is the trade you make when you pad.
Does this mean atomics are slow? No. The right-hand column is an atomic increment at about 6 to 8 nanoseconds. The instruction is cheap. Waiting for ownership of the line is not.
One caveat belongs in the open. My first version of this program used plain volatile stores and showed no gap on this VM. Atomic read-modify-write operations did. I did not isolate why. A plausible reason is that plain stores retire into the store buffer and overlap the line transfer, while a locked operation has to wait for it. That is a hypothesis, not a measurement. I also cannot see from inside the VM how the host placed my two vCPUs, which Post 4 explains. Treat 7x to 10x as what this machine did, and rerun it on yours.
The serial fraction sets the ceiling
Amdahl’s law, from a 1967 paper, says that if a fraction p of your work parallelizes across n cores, the speedup is 1 / (s + p / n), where s is the serial remainder, 1 minus p. The serial part never shrinks. Nine lines of Python build the table.
# amdahl.py: the speedup ceiling that the serial fraction sets.
def amdahl(p, n):
return 1 / ((1 - p) + p / n)
ns = (2, 8, 64, 1024)
print("speedup (rows: parallel fraction p, columns: cores n)")
print(" p " + "".join(f"{n:>9d}" for n in ns) + " ceiling")
for p in (0.50, 0.90, 0.95, 0.99):
print(f" {p:5.2f} " + "".join(f"{amdahl(p, n):9.2f}" for n in ns) + f"{1 / (1 - p):10.1f}")
speedup (rows: parallel fraction p, columns: cores n)
p 2 8 64 1024 ceiling
0.50 1.33 1.78 1.97 2.00 2.0
0.90 1.82 4.71 8.77 9.91 10.0
0.95 1.90 5.93 15.42 19.64 20.0
0.99 1.98 7.48 39.26 91.18 100.0
Read the p = 0.95 row. Sixty-four cores deliver 15.42x, which is 24% efficiency per core. A thousand and twenty-four cores deliver 19.64x, and the ceiling is 20. The extra 960 cores bought you 4.2 more units of speedup. At p = 0.99 the ceiling is 100, and 1,024 cores reach 91.18. So how much of your program is truly parallel? Measure that before you buy cores.
A core is also not always a core. With simultaneous multithreading, one core exposes two hardware threads that share its execution resources. A Xeon 6 part with 86 cores shows 172 logical CPUs. The second thread earns throughput when the first stalls on memory. It does not give you a second core. Post 5 covers what SMT costs in security.
Want to see all of this on your own machine? Run lstopo from hwloc and read the tree: sockets, caches, cores, threads, memory.
One core cannot spend what the memory can deliver
Memory bandwidth is multiplication. A DDR5-6400 channel moves 6,400 megatransfers per second, 8 bytes each: 51.2 GB per second. Write the speed as MT/s, not MHz. Data moves on both clock edges, so the I/O clock runs at 3,200 MHz, and Lenovo’s guides write MHz, so expect the labels to differ.
Underneath, each DDR5 DIMM splits that 64-bit channel into two independent 32-bit subchannels, each with its own command and address bus (DDR5 overview). A 32-bit subchannel with a burst of 16 delivers 64 bytes, exactly one cache line.
But peak is a ceiling, not a flow. Little’s law says the data in flight equals bandwidth times latency. At an idle latency of 100 nanoseconds, a figure I assume here and that two-socket servers roughly measure, one channel needs 51.2 GB/s times 100 ns. That is 5,120 bytes, or 80 cache lines, in flight at once. Eight channels need 640. The script below does that arithmetic, and also produces the server rows and the PCIe lane budget that appear later in this post.
# memory_math.py: Little's law, the Lenovo bandwidth rows and the PCIe lane budget, recomputed from their inputs.
def channel_gbs(mts): # MT/s x 8 bytes per transfer
return mts * 8 / 1000
LINE, LAT_NS = 64, 100 # cache line bytes; assumed idle memory latency
bw = channel_gbs(6400)
in_flight = bw * LAT_NS # Little's law: GB/s x ns = bytes in flight
print(f"DDR5-6400 channel: {bw:.1f} GB/s; at {LAT_NS} ns, {in_flight:.0f} bytes = {in_flight / LINE:.0f} cache lines in flight")
print(f"8 channels: {8 * in_flight / LINE:.0f} cache lines in flight")
print("\npeak bandwidth = channels x MT/s x 8 bytes")
servers = [("SR650 V4, 1 DPC", 8, 6400, 86), ("SR650 V4, 2 DPC", 8, 5200, 86), ("SR665 V3", 12, 6400, 160)]
for name, ch, mts, cores in servers:
sock = ch * channel_gbs(mts)
print(f" {name:16} {sock:6.1f} GB/s per socket {sock / cores:6.2f} GB/s per core")
lane = 32 * (128 / 130) / 8 # GT/s x 128b/130b encoding / 8 bits per byte
print(f"\nPCIe 5.0: {lane:.2f} GB/s per lane per direction, x4 = {4 * lane:.2f} GB/s")
print(f"36 NVMe drives x 4 lanes = {36 * 4} lanes; two CPUs at 88 lanes each = {2 * 88}")
DDR5-6400 channel: 51.2 GB/s; at 100 ns, 5120 bytes = 80 cache lines in flight
8 channels: 640 cache lines in flight
peak bandwidth = channels x MT/s x 8 bytes
SR650 V4, 1 DPC 409.6 GB/s per socket 4.76 GB/s per core
SR650 V4, 2 DPC 332.8 GB/s per socket 3.87 GB/s per core
SR665 V3 614.4 GB/s per socket 3.84 GB/s per core
PCIe 5.0: 3.94 GB/s per lane per direction, x4 = 15.75 GB/s
36 NVMe drives x 4 lanes = 144 lanes; two CPUs at 88 lanes each = 176
Now the other half: how many misses can one core keep in flight? The next program builds a 512 MiB array holding one random cycle, far past any cache, and chases pointers through it. With one chain, every load waits for the previous one. With k chains, there are k independent loads available at once. If the core can overlap them, time per load falls by k.
// mlp.c: how many cache misses can one core keep in flight? Chase K independent pointer chains at once.
#define _GNU_SOURCE
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <time.h>
#define ENTRIES (1UL << 26) // 64M entries x 8 bytes = 512 MiB, far past the caches
#define STEPS 2000000L
static volatile uint64_t sink;
static uint64_t rng = 88172645463325252ull;
static uint64_t xorshift(void) {
rng ^= rng << 13; rng ^= rng >> 7; rng ^= rng << 17;
return rng;
}
static uint64_t now_ns(void) {
struct timespec t;
clock_gettime(CLOCK_MONOTONIC, &t);
return (uint64_t)t.tv_sec * 1000000000ull + t.tv_nsec;
}
static void print_thp(void) { // how much of the array did the kernel back with huge pages?
FILE *f = fopen("/proc/self/smaps_rollup", "r");
char line[256];
while (f && fgets(line, sizeof line, f))
if (!strncmp(line, "AnonHugePages:", 14)) printf("%s", line);
if (f) fclose(f);
}
int main(void) {
uint64_t *next = aligned_alloc(2 << 20, ENTRIES * 8);
madvise(next, ENTRIES * 8, MADV_HUGEPAGE);
for (uint64_t i = 0; i < ENTRIES; i++) next[i] = i;
for (uint64_t i = ENTRIES - 1; i > 0; i--) { // Sattolo shuffle: one random cycle through every entry
uint64_t j = xorshift() % i, t = next[i];
next[i] = next[j];
next[j] = t;
}
print_thp();
int ks[] = {1, 2, 4, 8, 12, 16, 20, 24, 32};
double base = 0;
printf("chains ns per load speedup\n");
for (int q = 0; q < 9; q++) {
int k = ks[q];
uint64_t p[32];
for (int c = 0; c < k; c++) p[c] = xorshift() % ENTRIES;
uint64_t t0 = now_ns();
for (long s = 0; s < STEPS; s++)
for (int c = 0; c < k; c++) p[c] = next[p[c]]; // each load depends only on its own chain
double ns = (now_ns() - t0) / (double)(STEPS * k);
for (int c = 0; c < k; c++) sink += p[c];
if (!base) base = ns;
printf("%6d %11.1f %6.1fx\n", k, ns, base / ns);
}
return 0;
}
$ ./mlp
AnonHugePages: 524288 kB
chains ns per load speedup
1 178.7 1.0x
2 89.5 2.0x
4 44.4 4.0x
8 22.4 8.0x
12 15.5 11.6x
16 12.4 14.4x
20 11.5 15.5x
24 10.5 17.1x
32 8.2 21.8x
Up to 8 chains the speedup is almost exactly linear: 2.0x, 4.0x, 8.0x. Then it bends, and it is still climbing at 32 chains, where each load costs 8.2 nanoseconds instead of 178.7. That is 21.8x. Dividing the two latencies says this core overlapped about 22 misses. An earlier run of the same program reached 25.5x, so quote that as 22 to 25. It is an effective overlap, not a count of hardware buffers, and the single-chain latency of 178.7 ns is well above my assumed 100 because a VM adds a second page-table walk to some misses. I did not separate those effects.
Now the consequence. At 8.2 ns per 64-byte line, one core pulled 7.8 GB/s of random reads. A DDR5-6400 channel can deliver 51.2. So one core uses 15% of one channel, and it takes about 6.6 cores to drain one channel and about 52 to drain the eight channels of an SR650 V4 at 1 DIMM per channel (409.6 / 7.8). Random reads are the hard case. Sequential reads engage the prefetcher and move more per core. The point stands for the access patterns that hurt: the RAM you paid for only gets used when many cores each keep misses in flight.

Storage learned the same lesson
SATA’s AHCI interface has one command queue with room for 32 commands. SAS has one queue of 256. NVMe allows up to 64K I/O queues, each up to 64K commands deep (Western Digital). Real devices expose far fewer, roughly 16 to 256 queues with depths from 32 to 2,048 (Oracle), which is still enough to give each core its own.
That is what blk-mq does. Per-core software queues map onto the device’s hardware queues, and the shared lock leaves the submission path. It was fully implemented by kernel 3.16 in 2014 (HotStorage 2023). So is NVMe fast because flash is fast? Partly. Much of the gain is protocol parallelism: queues per CPU, deep queues, no shared lock.
Then come lanes. An NVMe drive typically takes four PCIe lanes. PCIe 5.0 runs 32 GT/s per lane. With 128b/130b encoding that is 3.94 GB/s per lane per direction, 15.75 GB/s for an x4 drive, which is the figure the script above printed. Storage parallelism hits the lane budget before it hits the flash.
Two servers, opposite bets
Two Lenovo 2U servers make a clean contrast, because they make opposite bets. The figures below come from the October 2026 revisions of the SR650 V4 and SR665 V3 product guides. Lenovo revises these often, so check the date on the version you read. The bandwidth rows are the script’s output, not Lenovo’s.
| Spec | SR650 V4 (Intel) | SR665 V3 (AMD) |
|---|---|---|
| CPUs | 2x Xeon 6700/6500 P-core, up to 86 cores / 172 threads each | 2x EPYC 9005, up to 160 cores / 320 threads each |
| Memory channels per CPU | 8, two DIMMs per channel | 12, one DIMM per channel |
| DIMM slots, maximum capacity | 32, up to 8 TB | 24, up to 6 TB |
| DDR5 speed | 6,400 MT/s at 1 DIMM per channel; 5,200 MT/s at 2 | 6,400 MT/s |
| Peak bandwidth per socket (script output) | 409.6 GB/s at 1 DPC; 332.8 GB/s at 2 DPC | 614.4 GB/s |
| Peak per core, top-bin CPU (script output) | 4.76 GB/s at 1 DPC; 3.87 GB/s at 2 DPC | 3.84 GB/s |
Read the last row twice. The AMD part has 86% more cores and 50% more channels, and it still has less peak bandwidth per core than the Intel part at one DIMM per channel. Filled to its 8 TB maximum with two DIMMs per channel, the Intel part drops to almost the same per-core number. Capacity costs bandwidth, and core count dilutes it. Lenovo’s own rule is to populate every channel, and the arithmetic shows why.
Set that against the measurement. At 86 cores the socket offers 4.76 GB/s per core. A core pulling 7.8 GB/s of random reads is already above that share, so about 52 busy cores exhaust the socket. “Which server is faster” is the wrong question. “Which resource does my workload run out of first” is the right one. These are peaks for the biggest CPUs, not what your workload will see.
The storage side follows the same logic. The SR650 V4 guide lists 36 NVMe drives without PCIe oversubscription. At four lanes each that is 144 lanes, against the 176 that two CPUs provide at 88 apiece. Every drive gets a full path to a CPU. Count your network cards and accelerators before you trust that headroom, because past that point drives share lanes behind a switch.
ThinkAgile HX is the same hardware with Nutanix already installed. The HX630 V4 sits on the SR630 V4 base and the HX650 V4 on the SR650 V4, and the hypervisor is Nutanix AHV or VMware ESXi (HX630 V4, HX650 V4). Disclosure: I work with Nutanix every day and I prefer it, so weigh this paragraph with that in mind. The architecture point stands either way. A Nutanix node runs a controller VM that serves its local drives to the whole cluster, so every node’s drives join one storage pool. That VM is a tenant on the same cores as your workloads. Post 4 explains what tenants on shared cores cost. AHV is built on KVM, which is why this series uses KVM as its running example.
One thing the spec sheet hides
Each socket has its own memory controllers and its own DIMMs. A core reaches its own socket’s memory directly, and the other socket’s memory across an inter-socket link, at a higher latency. That is NUMA, non-uniform memory access, and the most useful way to hold it is this: memory has a location.
“One NUMA node per socket” is already too simple. The SR650 V4 guide describes up to 12 CXL 2.0 memory modules, six per CPU. In its two-tier mode, DDR5 and CXL show up as separate NUMA nodes. Post 5 puts numbers on all of it.
What to carry forward
The flash was ready. The kernel was not. Whenever your hardware goes parallel, ask which part of the stack is still serial. It might be a lock, a queue, a cache line two threads share, a single thread that touches all the memory, or a spec sheet you read by core count instead of bandwidth per core.
Takeaways
- Parallel hardware pays off only when software gives it parallel work, and Amdahl’s serial fraction sets the ceiling.
- Two counters in one cache line cost 7x to 10x here; pad hot per-thread data to its own line and measure.
- Compute DDR5 peak as channels x MT/s x 8 bytes, and write the speed in MT/s.
- One core overlapped about 22 misses and reached 7.8 GB/s, so memory only fills when many cores run.
- NVMe’s gain is mostly queue parallelism, and blk-mq is the kernel’s half of it.
- Compare servers by bandwidth per core and PCIe lanes per drive, not by core count.
Published November 22, 2026