DataPath

Memory bandwidth and placement

Is DataPath's large-message latency at the memory-bandwidth limit, or is it spent signalling through the kernel and scheduler? Measured on merenka-gpu0 (AMD EPYC 7313P, container with CPUs 0–7 and 16–23 on two CCDs) on 2026-11-23, DataPath cdc663a over shared memory, idle. A 1 MiB round trip copies 2 MiB: the client copies its message into the ring, and the server copies the received bytes into its reply.

Short answer: it's copy time, and where the two processes run decides how fast the copy is. Signalling is about 13 µs of a 190 µs round trip. Pinned to different CCDs, 1 MiB p99.9 is 329 µs; on one CCD it is 102 µs, and on the two hyper-threads of one core 70 µs.

memcpy on this machine

membw.cpp, one thread on CPU 1, per-copy time:

Copy p50 p99.9 GB/s at p50
64 KiB, in cache 1.15 µs 1.75 µs 57
64 KiB, cold (512 MiB buffer set) 4.04 µs 9.13 µs 16
256 KiB, in cache 5.23 µs 10.1 µs 50
256 KiB, cold 15.5 µs 22.3 µs 17
1 MiB, in cache 25.2 µs 33.7 µs 42
1 MiB, cold 61.1 µs 81.8 µs 17

Aggregate (1 MiB cold copies, all threads at once): 17.6 GB/s with one thread, about 19–20 GB/s with 2–4 threads on one CCD, 33 GB/s with 8 threads across both CCDs, 32 GB/s with all 16. One CCD tops out near 20 GB/s of copying.

Where a 1 MiB round trip goes

The library and benchmark were instrumented locally with CLOCK_MONOTONIC stamps around the ring copy, the eventfd write, and the receive (the instrumentation is not part of DataPath). Per-phase times in µs, 5 runs of 2,048 round trips:

--pin Placement round trip p50 / p99.9 client copy p50 / p99.9 server copy p50 / p99.9 signal + wake per direction, p50
1,5 different CCDs 190 / 329 115 / 234 60 / 178 1.7 + 4.7
1,2 same CCD 60 / 102 26 / 36 33 / 43 receiver still spinning, 0.25
1,17 one core's two hyper-threads 52 / 70 25 / 38 25 / 37 receiver still spinning, 0.27

At 256 KiB the pattern is the same: 153 µs p99.9 across CCDs against 21.7 µs on one CCD, with the client copy at 29.5 vs 5.7 µs p50.

Under load

256 KiB with --stress 0 --stress-nice 12, unpinned, three invocations: the median round trip is still mostly copy (about 30 + 30 µs of 64 µs), but the p99.9 tail (0.2–4 ms) is scheduling. Delivery gaps of milliseconds appear when a receiver that went to sleep waits for a timeslice, and an eventfd write can take up to 220 µs when waking the receiver preempts the sender. With a 100 ms spin the receivers never sleep, but the tail stays at about 4 ms: then the spinning thread itself is preempted.

What this means

View this page on GitHub