🌐 Languages: 中文 · English

Both were reasonable in 2000. Our ATC ‘26 paper works around them on NICs you already own, with a page full of 0xDEADBEEF.

Cover: the NIC asks for five pages. The IOMMU hands back four real ones and, for the page that has been swapped out, a page full of 0xDEADBEEF.Cover: the NIC asks for five pages. The IOMMU hands back four real ones and, for the page that has been swapped out, a page full of 0xDEADBEEF.

A minor page fault, where the page is in RAM and only needs mapping, costs your operating system a few microseconds.

Let an RDMA NIC take that fault on behalf of a remote machine and the request stalls for about 2 ms on a Mellanox ConnectX-5 and 16 ms on a ConnectX-6. That is hundreds to thousands of times longer, and every other request on the connection waits behind it.

Our fix is to never let the NIC fault. When the page it wants has been swapped out, we quietly hand it a page full of 0xDEADBEEF and let the reader notice.

Why page fault matters today

RDMA lets one machine read and write another’s memory through the NIC, without involving the remote CPU. It is the fastest way we have to move bytes between machines. The catch is that the memory must be pinned: the OS may never move it or swap it out.

That was a fair trade when RDMA served supercomputers with fixed buffers. It is a bad one for the memory programs actually live in today.

Three kinds of systems want remote peers to read their memory in place: analytics heaps, storage caches and pointer-heavy services. None of them can afford to pin it, and what RDMA offers today is to pin everything, copy into a pinned buffer, or page on demand.Three kinds of systems want remote peers to read their memory in place: analytics heaps, storage caches and pointer-heavy services. None of them can afford to pin it, and what RDMA offers today is to pin everything, copy into a pinned buffer, or page on demand.

  • Analytics engines like Spark size a JVM heap for the worst case and use a fraction of it at any moment. Pinning the heap means paying for all of it.
  • Storage systems put DRAM in front of far more SSD than they have memory. Pages moving in and out is how they work.
  • Pointer-heavy services such as graph stores keep objects wherever the allocator put them. To use RDMA they must copy everything into a special pinned region, or be rewritten around one.

The most common workaround is a small pinned buffer that everything else gets copied into. Spark’s RDMA transport copies objects out of the Java heap into a separate pinned buffer before sending them.

SymRDMA is our ATC ‘26 paper, first posted as a preprint called NP-RDMA in October 2023. I was also on the early team behind Unified Bus, an interconnect where we were free to change the hardware. Put the two side by side and you can see two decisions in RDMA’s design that were reasonable in 2000, when commodity servers had no IOMMU, and are mistakes now:

  1. The NIC keeps its own page table, and has no cheap way to miss in it.
  2. A connection is a strict queue, so one slow request blocks everything behind it.

SymRDMA works around both on hardware you can already buy. Unified Bus avoids both by design.

Mistake #1: the NIC keeps its own page table

Your program uses virtual addresses. The OS owns the page table that maps them to physical memory, and it rewrites that table all the time: swapping cold pages out, compacting, reclaiming.

An RDMA NIC needs the same mapping, so it keeps a private copy, the Memory Translation Table (MTT), cached on the NIC. Two copies of one mapping have to agree. RDMA’s original answer was the crudest one available: pin the memory, so the original never changes and the copy never goes stale.

Standard RDMA keeps a private copy of the page table on the NIC and keeps it coherent by pinning the memory. SymRDMA sets the NIC's table to an identity map and lets the kernel keep the IOMMU's page table up to date.Standard RDMA keeps a private copy of the page table on the NIC and keeps it coherent by pinning the memory. SymRDMA sets the NIC's table to an identity map and lets the kernel keep the IOMMU's page table up to date.

Much of what people dislike about RDMA follows from that.

  • Pin the whole heap, and Spark holds 3–7× more physical memory than it uses and spends 51 seconds registering a 128 GB heap, that is, pinning it and loading its mapping into the NIC. (SymRDMA takes 2.6 seconds.)
  • Pin a small buffer and copy into it, and you have given back the zero-copy you bought RDMA for. Copying and serialization can eat 40–60% of CPU cycles in data-intensive workloads.
  • Unpin, and let the NIC fault on demand. This is On-Demand Paging (ODP), and it is where the milliseconds come from. ODP does keep the NIC’s copy coherent: the kernel tells the driver when a page leaves. What it lacks is a cheap miss. The NIC handles the fault synchronously and freezes the connection, and the NIC at the other end ends up waiting on a millisecond-scale retry timer.

Two copies would be tolerable if hitting a stale entry were cheap. It is not, and that is the real defect: the NIC has no cheap, recoverable way to miss.

Our trick: never let the NIC fault

Every modern server has an IOMMU. It sits between devices and memory and translates the addresses devices use, through an ordinary page table in host memory that the kernel can edit in place.

SymRDMA demotes the NIC’s table. We program it once as an identity map (address in equals address out) in 2 GB chunks, so a 128 GB heap needs a few dozen NIC entries and they never fall out of the NIC’s cache. The per-page entries do not disappear. They move into IOMMU page tables in host DRAM, where repointing one costs the kernel 3–8 µs on the swap-out path.

An IOMMU cannot take a miss gracefully either. So we never leave an entry empty:

When a page is swapped out, we point its IOMMU entry at a spare page filled with 0xDEADBEEF.

Redirect, detect, repair. A swapped-out page is remapped to a sentinel page of 0xDEADBEEF, the reader checks what arrives, and the target repairs the one request that missed.Redirect, detect, repair. A swapped-out page is remapped to a sentinel page of 0xDEADBEEF, the reader checks what arrives, and the target repairs the one request that missed.

The NIC reads the fake page without complaint and ships it across the network. No fault, no stall, no timeout. The reader looks at what arrived, and if it sees the magic number it knows the read was bogus. (If your real data happens to be 0xDEADBEEF, you take the slow path too and still get the right answer.)

Three things break the simple version:

  1. Writes cannot use the sentinel, because they would overwrite it. They are redirected to a second “black-hole” page that nobody reads, and a read-back of the same bytes, posted right behind the write, exposes the miss.
  2. A NIC does not read a page atomically. On these machines it moves data in PCIe packets of at most 256 bytes, so half of your read can be real and half fake. We check four bytes in every 256-byte chunk.
  3. Reading back a large write would double the traffic. Transfers of 4 KB and up use a 4-byte version counter per page instead, bumped on every swap and read before and after the transfer. It is a seqlock, a version check that readers retry on, stretched across the network.

When a check fails, the reader sends a repair request over a small pinned control channel. The target’s CPU swaps the page in the ordinary way, then does the read or write itself, from its own side. A remote read that hits a minor fault is handled in 3.5 µs, against roughly 2 ms for ODP in the same test: 594× faster. If the page has to come back from SSD it takes about 60 µs, nearly all of it the SSD.

We published this design in October 2023, as the NP-RDMA preprint. TeRM, which appeared at FAST ‘24 four months later, uses the same magic-page check. It installs the page in the NIC’s own table, applies it to reads in storage systems, and sends writes through RPC. SymRDMA does the redirection in the IOMMU and keeps writes and large transfers one-sided as well.

Mistake #2: a connection is a strict queue

Fixing the fault handler is not enough. A page on SSD takes tens of microseconds to come back, and no NIC design can change that. A reliable RDMA connection promises that operations take effect in the order they were posted. So one slow page blocks every request behind it, including the ones that touch memory sitting in RAM.

Strict order plus wildly variable latency gives you head-of-line blocking. CPUs met this decades ago, when one cache miss could stall the whole pipeline, and learned to execute out of order.

SymRDMA does something similar on a connection. It tracks the address ranges of in-flight operations. A request that overlaps one of them waits, and so does everything posted after it. Otherwise, later requests run straight past the faulting one while it is being repaired. The application still sees completions (the NIC’s done-notifications) in the original order. The later requests have already run; they only wait to be reported, for microseconds.

With strict ordering, one swapped-out page stalls every request behind it. SymRDMA lets independent requests run past the faulting one and still reports completions in the original order.With strict ordering, one swapped-out page stalls every request behind it. SymRDMA lets independent requests run past the faulting one and still reports completions in the original order.

The CPU analogy breaks in one place, and it is the main limit of the design. A CPU hides its reordering. We cannot: the remote memory really is written in a different order, and a third party can see it. This is closer to a weak memory model with fences. A program that writes data to one address and then a “ready” flag to another, without waiting for the first completion, can break. For that there are two opt-in hint bits per request, and a switch that restores strict order for unmodified programs. With the switch on, requests run one at a time: a fault costs only its repair time, but you give up pipelining. None of our three applications needed either.

Relaxing order is not a new idea. Multipath transports such as MP-RDMA do it to survive packet reordering, and newer ones such as AWS’s SRD and Ultra Ethernet offer unordered delivery. Page faults are a second, independent reason.

What it buys, what it costs

Results: a remote read that hits a minor page fault is handled 594× faster than with ODP; Spark matches fully pinned speed on 3–7× less memory; storage holds five times more data behind the same DRAM for 9% more average latency.Results: a remote read that hits a minor page fault is handled 594× faster than with ODP; Spark matches fully pinned speed on 3–7× less memory; storage holds five times more data behind the same DRAM for 9% more average latency.

  • Spark on TPC-DS, a standard analytics benchmark: within 0–5.4% of pinning the entire heap, a gap comparable to run-to-run variance, on 3–7× less memory. ODP is 5–6× slower. Spark’s production RDMA path (UCX) is 1.5–1.7× slower, though that comparison also changes the transport.
  • Enterprise storage: five times more data than fits in DRAM, for 9% higher average latency. Copying costs 45%; ODP costs 6×. Tail latency rises by about 200 µs, the cost of the SSD read.
  • Pointers that cross machines: graph queries over an ordinary C++ std::unordered_map, with the client following pointers into the server’s heap. That is 11–14× lower latency than gRPC and 2.2–2.4× lower than copying.
  • When nothing faults: reads take 0.4–1% longer than raw RDMA.

The costs:

  • To deploy: a 2,800-line patch to the Mellanox driver, the IOMMU switched on, and one busy-polling thread per process. Standard verbs on reliable connections only; tested on ConnectX-5/6 with Intel’s IOMMU (VT-d).
  • What gets slower: small writes that each wait for their own completion lose about half their throughput. Atomic operations (compare-and-swap, fetch-and-add) become an RPC to the remote CPU. The first access after a page returns to RAM still takes the repair path. Strict-order mode gives up pipelining. Prior work measured up to 22% loss from IOMMU translation-cache misses under adversarial access patterns; pinned deployments with the IOMMU off do not pay it.
  • What it does not do: it catches races with the OS’s paging, not races in your program. And a peer with read access can tell which pages are swapped out, as it can with ODP through timing.

What the right design looks like

SymRDMA is a workaround, and I would be glad to see it become unnecessary.

I spent much of my PhD trying to build total ordering into the network itself, and came away believing the opposite: strong order should be something an application asks for, not something every request pays for.

Unified Bus is Huawei’s interconnect for AI clusters; its specification was published last year. It takes both lessons as starting points. Translation goes through a memory-management unit that is part of the bus (the UMMU), and remote memory can be mapped into a local address space and reached with ordinary load and store instructions. Fault handling gets its own virtual channel, a separate lane on the link, so it cannot deadlock against the access that caused it. Every transaction declares the execution order it needs (none, relaxed, or strong, plus an explicit fence), completion order is a separate dial, and out of order is the default.

On a rack of ConnectX-5s we approximate the first with the IOMMU, and the second with an address-overlap check and two reserved bits.

Commodity NICs could get closer. If they shared the CPU’s page tables through the IOMMU (a feature called SVA), there would be no second copy and no sentinel page. The hard part is the one this post started with, a cheap and recoverable I/O page fault, and it needs changes to both the RDMA protocol and the hardware.

SymRDMA is joint work led by Huijun Shen with Guo Chen’s group at Hunan University. Paper · Preprint (NP-RDMA, 2023) · Code · Unified Bus essay

Comments

▲