3 ms·
NUMA systems are annoying for also other reasons. RDTSC is typically CPU socket dependent. Different CPU sockets have different counts. So even with constant TS
by vardump 11y ago
NUMA systems are annoying for also other reasons. RDTSC is typically CPU socket dependent. Different CPU sockets have different counts. So even with constant TSC (time stamp counter), you can't compare TSC values between different sockets. As a workaround, you need to also somehow record the CPU socket information together with timestamp. Which is hard unless you're in kernel context. Well, there's RDTSCP, but it also requires kernel to load appropriate values to IA32_TSC_AUX MSR.
When requesting high precision time stamps, some operating systems fall back to APIC or HPET. The issue is these are 2-3 orders of magnitude slower to query than TSC. TSC takes a few nanoseconds to acquire, APIC / HPET can take a few microseconds, which can sometimes be too much.
Thus precision timing and timing sensitive code is somewhat tricky on NUMA systems.
Another annoyance is how easy it is to saturate a NUMA interconnect with synchronization traffic. Atomic ops (and by extension, mutexes, semaphores, etc.) can easily bottleneck a NUMA system.