It Scaled On My Laptop

You are reviewing a change that fixes false sharing in a hot counter array. The author writes:

I benchmarked the original code on my quad-core desktop with 1, 2, 3 and 4 threads. The time barely moved. False sharing is a textbook problem that modern CPUs handle; I am removing the padding to shrink the struct.

The same microbenchmark on a four-socket machine is 11 times slower at 4 threads than at 1. Both measurements are real. What should you conclude?

A

The four-socket machine is slower because of NUMA page placement, not false sharing, so padding is the wrong fix there too.

B

On one package the contended line never leaves the shared last-level cache, so a single-socket run does not reproduce the cost and cannot be used to justify removing the padding.

C

False sharing was a bus-era problem that on-die caches have made obsolete, so the padding really is dead weight.

D

The desktop has a larger L1d, so the four counters fit and no eviction occurs.