← all posts
September 26, 2026·Ronald Adonyo· 8 min read

The tail stall: rescuing a stranded Thunderbolt ACK, 3945µs → 208µs

The short final frame of every multi-fragment WQE stranded its SEND_ACK on the Asahi NHI, and the QP retry ladder took 73–143ms to notice. An immortal poll and an 800µs rescue took 8097B pingpong from 3945 to 208 µs per iteration. The session also hit a perftest version mismatch, an unsteerable AIC2 and a volume that corrupts builds.

3945 → 208 µs/iter8097B pingpong
938 MiB/sib_write_bw, 256 KiB peak
1.99–3.12 µsbusy-poll CQ floor
rdmathunderboltkernelapple-silicondebuggingbenchmarking
Stepping stones across the lake shallows to a far bank where a stack of large parcels has arrived, and one small parcel left alone on a stone mid-water with a slack cord tied to it; a shoebill stands motionless beside it and a crested crane at the right looks at it.
Was called
a stall at the tail
Was
the short final frame's stranded SEND_ACK

This ⁠session ‌targeted ‌the ​Thunderbolt ‌4 ​RDMA ‌leg ‌between ‌an ‌M2 ‌Ultra ‌Mac ​Studio ​running ‌Asahi's ​7.1.13-usb4gpu ​kernel ​(the ​Mac ​Studio ​in ​the ‌diagram ​below) ‌and ‌an ​AMD ‌Strix ‌Halo ‌desktop. ‌The ​reference ‌numbers ‌belong ‌to ‌MCDMA, ​who ​connect ​a ​Mac ‌Studio ⁠to ⁠DGX ‌Sparks ‌and ​publish:

MCDMA (Mac Studio ↔ DGX Sparks)published
4 KiB RDMA WRITE3.68 µs
sustained READ50.6 Gbit/s

MCDMA's ‌roadmap ​asks ‌for ‌"Strix ‌Halo ‌+ ‌Vulkan ‌— ​hardware ​sought." ‌That ​is ​the ​setup ​already ​cabled ​on ​this ‌bench. ​The ‌session ‌produced ​five ‌results: ‌one ‌link ‌restored ​from ‌cold, ‌one ‌negotiation ‌blocker, ​one ​real ​bug ​found ‌and ⁠fixed, ⁠one ‌kernel ‌patch ​left ‌parked ​at ‌a ‌GRUB ‌menu, ‌and ‌one ‌storage ​volume ​that ‌has ​been ​corrupting ​everything ​built ​on ​it.

The ​leg ‌had ​been ‌down, ‌so ​the ‌first ‌hours ‌went ‌to ​restoring ‌it. ‌The ‌existing ‌playbook ​held: ​staged-boot ​module ​discipline ‌on ⁠both ⁠ends, ‌and ‌canonical ​per-leg ‌configurations ​applied ‌by ‌tbv-configure-leg.sh ‌so ‌that ‌neither ‌host ​drifts ​into ‌a ​configuration ​only ​one ​of ​them ​remembers.

The ​one ‌real ​fault ‌was ‌a ​subnet ‌mismatch. ‌The ‌fix ‌was ​a ‌secondary ‌address ‌on ‌the ​interface ​plus ​permanent ​neighbors, ‌so ⁠ARP ⁠never ‌has ‌to ​rediscover ‌a ​peer. ‌A ‌plain ‌ping ‌across ‌the ‌Thunderbolt ​cable ​then ‌settled ​at ​0.23 ​ms, ​and ​the ​transport ​was ‌no ​longer ‌a ‌variable.

perftest wire format mismatch

The ​benchmark ‌tooling ‌failed ‌before ‌the ​hardware ‌did. ‌Four ‌perftest ‌binaries ​were ​in ​use ​across ‌the ⁠two ⁠machines, ‌and ‌three ​of ‌them ​claimed ‌version ‌6.29. ‌Every ‌pair ‌failed ‌negotiation. ​The ​version ‌strings ​matched ​and ​the ​wire ​formats ​did ​not. ‌The ​fix ‌was ‌to ​build ‌one ‌source ‌revision, ‌perftest-master ​(version ‌6.30), ‌on ‌both ‌architectures ​and ​retire ​the ​rest.

With ‌a ⁠common ⁠wire ‌format, ‌ib_write_bw ​finally ‌produced ​a ‌number:

measurementvalue
ib_write_bw, 256 KiB peak938 MiB/s ≈ 7.87 Gbit/s
record, 2026-09-15995.93 MiB/s = 8.36 Gbit/s
gapwithin 6%

Being ‌within ‌6% ‌of ‌the ‌previous ​record ​is ‌not ​an ​improvement, ​but ​it ​is ​a ​working ‌baseline ​that ‌agrees ‌with ​history, ‌which ‌a ‌benchmark ‌harness ​needs ‌before ‌the ‌kernel ‌changes.

The tail stall

Every ​multi-fragment ​WQE ​ends ​with ‌a ⁠short ⁠final ‌frame, ‌last_len=4048, ​which ‌is ​4096 ‌minus ‌the ‌48-byte ‌header. ‌That ‌frame's ​SEND_ACK ​was ‌repeatedly ​stranded ​on ​the ​Mac ​Studio's ​Asahi ​NHI ‌without ​an ‌interrupt, ‌so ​the ‌receiving ‌path ‌never ‌noticed ​it ‌had ‌arrived. ‌The ‌supplemental ​RX ​poll ​had ​quit ‌16 ⁠ms ⁠after ‌the ‌last ​TX ‌post. ​Past ‌that ‌point ‌recovery ‌fell ‌to ‌the ​QP ​retry ‌ladder, ​which ​eventually ​released ​the ​ACK ​at ​73–143 ‌ms ​per ‌stall. ‌Every ​multi-fragment ‌transfer ‌paid ‌that ‌tail.

mermaid
flowchart TD
    subgraph BEFORE["Before: the tail stall"]
        A["multi-fragment WQE posted; final frame short (last_len=4048 = 4096 - 48 header)"] --> B["SEND_ACK stranded on the Mac Studio's Asahi NHI, no interrupt raised"]
        B --> C["supplemental RX poll quit 16 ms after the last TX post"]
        C --> D["recovery falls to the QP retry ladder: 73-143 ms"]
    end
    subgraph AFTER["After the patch"]
        E["immortal supp poll, 1 ms idle cadence"] --> F["tx_ack_rescue_us=800 fast ACK-wait rescue"]
    end
    BEFORE ==>|"8097B pingpong 3945 to 208 us per iter, 19x"| AFTER

The ​patch ‌has ‌three ‌parts:

  1. An ‌immortal ​supplemental ​poll ​with ​a ‌1 ⁠ms ⁠idle ‌cadence, ‌so ​the ‌receive ​path ‌never ‌stops ‌polling.
  2. A ‌fast ‌ACK-wait ‌rescue, ​tx_ack_rescue_us=800, ​which ‌checks ​a ​sender ​waiting ​on ​an ​ACK ​at ‌800 ​µs ‌instead ‌of ​at ‌retry-timer ‌scale.
  3. Hardening ‌around ‌the ​edges: ‌the ‌NULL-path ‌timeout ‌reaper ​no ​longer ​emits ​wire ‌ACKs, ⁠and ⁠rings ‌are ‌quiesced ​before ‌tb_ring_stop.

Measured ​before ‌and ‌after:

probebefore the patchafter
8097-byte pingpong3945 µs/iter208 µs/iter (19×)
64 KiB writehangcompletes
1 MiB writecrashed the host, five timessurvives

The ‌hardening ‌has ‌a ‌further ​effect: ​rmmod ‌on ​the ​Strix ​Halo ​host ​with ​the ​rail ‌live ​is ‌now ‌survivable, ​which ‌it ‌was ‌not ‌before. ​The ‌64 ‌KiB ‌case ‌going ​from ​"hang" ​to ​"completes" ‌and ⁠the ⁠1 ‌MiB ‌case ​going ‌from ​"five ‌host ‌crashes" ‌to ‌"survives" ‌separate ‌a ​demo ​from ‌a ​fabric ​that ​can ​be ​left ​switched ​on.

Latency ladder

With ‌the ​tail ‌gone, ‌the ​latency ‌ladder ‌became ‌readable. ‌The ​2-byte ‌RTT ‌dropped ‌from ‌29.9 ​µs ​to ​26.3 ​µs, ‌and ⁠the ⁠driver ‌was ‌not ​the ‌cause. ​The ‌Strix ‌Halo ‌host ‌had ‌been ‌on ​the ​powersave ‌governor.

rungmeasured
2-byte RTT, before29.9 µs
2-byte RTT, governor fixed26.3 µs
busy-poll CQ floor, min1.99–3.12 µs
p50 through the kernel path~20 µs
4000-byte busy-poll throughput2157 Mbit/s

The ​busy-poll ​CQ ​harness ​is ​the ​rung ​that ‌matters. ​Polling ‌the ‌completion ​queue ‌directly, ‌the ‌floor ‌min ​lands ‌at ‌1.99–3.12 ‌µs, ‌which ​is ​the ​hardware ​answering ‌without ⁠kernel ⁠mediation. ‌Sub-5 ‌µs ​RTT ‌on ​this ‌leg ‌is ‌therefore ‌reachable ‌if ‌the ​software ​between ‌the ​application ​and ​the ​CQ ​stops ​adding ​latency. ‌That ​software ‌currently ‌costs ​a ‌p50 ‌of ‌~20 ‌µs, ​attributed ‌to ‌kernel ‌reap ‌latency, ​though ​this ​session ​did ‌not ⁠isolate ⁠it. ‌The ‌gap ​between ‌2 ​µs ‌of ‌hardware ‌and ‌20 ‌µs ‌of ​p50 ​is ‌the ​remaining ​work.

AIC2: interrupts cannot be steered

The ​tail-stall ​investigation ​turned ​up ​a ‌second, ​independent ‌problem ‌in ​Apple's ‌interrupt ‌controller ‌driver. ‌aic2_chip ​has ‌no ‌.irq_set_affinity ‌implementation, ‌so ​every ​Apple ​AIC2 ​interrupt ‌returns ⁠EPERM ⁠when ‌steering ‌is ​attempted, ‌including ​the ‌NHI ‌ring ‌interrupts ‌this ‌workload ‌depends ​on. ​The ‌cause ​is ​structural. ​AIC1 ​kept ​per-CPU ​targets ​in ‌a ​TARGET_CPU ‌bank, ‌while ​AIC2 ‌stores ‌each ‌IRQ's ‌target ​individually ‌in ‌IRQ_CFG[TARGET], ‌GENMASK(3,0), ‌and ​the ​affinity ​infrastructure ​was ‌written ⁠for ⁠the ‌former.

A ‌kernel ​patch ‌was ​written. ‌The ‌install ‌then ‌failed: ‌the ‌boot ​attempt ​used ‌the ​wrong ​artifact, ​the ​zboot ​vmlinuz ​instead ​of ‌Image.gz, ​and ‌the ‌boot ​failed. ‌The ‌safety ‌net ‌worked ​as ‌designed. ‌The ‌Mac ‌Studio ​parked ​at ​the ​GRUB ‌menu ⁠with ⁠the ‌old ‌kernel ​preserved ‌at ​.aicbak.

Status: ‌patch ‌built, ‌steering ‌unverified, ‌recovery ‌pending. ​No ​AIC2 ‌improvement ​is ​claimed ​until ​the ​Mac ​Studio ​boots ‌the ​patched ‌kernel ‌and ​the ‌NHI ‌ring ‌IRQs ‌move ​when ‌asked.

A volume that corrupts builds

The ‌fast ‌shared ‌build ​volume ​is ​actively ​corrupting ‌file ⁠data. ⁠Files ‌that ‌had ​been ‌repaired ​reverted ‌to ‌their ‌broken ‌state, ‌and ‌kernel ​sources ​grew ‌binary ​junk. ​The ​failure ​is ​easy ​to ​recognize ‌once ​known, ‌but ‌it ​looks ‌like ‌compiler ‌trouble.

The ‌workaround ​is ‌to ‌freeze ‌a ‌clean ​source ​copy ​on ​the ‌root ⁠NVMe ⁠and ‌build ‌there. ​The ‌volume ​needs ‌fsck ‌and ‌SMART ‌checks ‌before ‌it ​is ​trusted ‌again. ​Every ​phantom ​build ​failure ​earlier ​in ​the ‌day ​traces ‌to ‌this ​cause ‌and ‌not ‌to ‌the ​compiler ‌or ‌the ‌code.

What worked and what did not

Worked: ‌kernel-adjacent ​debugging ​with ​a ​KVM ‌console ⁠as ⁠the ‌only ‌view ​of ‌the ​machine. ‌When ‌the ‌host ‌crashes ‌at ‌the ​NHI ​boundary, ‌logs ​after ​the ​fact ​are ​incomplete, ​and ​the ‌console ​shows ‌what ‌happened.

Did ​not ‌work:

  • rmmod ‌on ‌the ‌Mac ​Studio ‌crashed ‌it ‌instantly, ‌every ​time.
  • Live ​rmmod ​in ​general ‌panics ⁠the ⁠host.
  • A ‌runaway ‌log ​filled ‌a ​tmpfs ‌with ‌77 ‌GB ‌and ‌took ‌down ​whatever ​else ‌shared ​that ​filesystem.

Forbidden ​until ​guarded: ​the ​RDMA ​READ ‌verb. ​Issuing ‌it ‌crashes ​both ‌hosts. ‌The ‌native ‌backend ​does ‌not ‌implement ‌it, ‌and ​there ​is ​no ​graceful ‌refusal ⁠on ⁠the ‌wire. ‌READ ​is ‌not ​issued ‌on ‌this ‌fabric ‌until ‌that ‌path ​is ​guarded.

Next steps

Three ‌items, ​in ​order:

  1. Boot ​the ​Mac ​Studio ​from ​the ‌preserved ​.aicbak ‌kernel, ‌retry ​the ‌AIC2 ‌patch ‌install ‌with ​the ‌correct ‌Image.gz ‌artifact, ‌and ​verify ​that ​NHI ​ring ‌interrupts ⁠steer.
  2. Reconcile ⁠the ‌write ‌bandwidth ​average ‌with ​its ‌peak. ‌A ‌7.87 ‌Gbit/s ‌peak ‌next ​to ​a ‌lower ​average ​suggests ​the ​same ​tail-stall ​pattern ​in ‌a ​different ‌unit.
  3. Run ‌fsck ​and ‌SMART ‌on ‌the ‌build ​volume.

The ‌hardware ‌floor ‌is ‌2 ​µs ​and ​the ​kernel ‌currently ⁠charges ⁠twenty. ‌The ‌gap ​between ‌the ​two ‌is ‌now ‌documented, ‌and ‌most ‌of ​it ​has ‌a ​patch ​attached.

boracode.ai · Ronald Adonyo · tb4-rdma-tail-stall
content hash d7e405bde157
A wide horizon at dusk: layered hills in muted plum and ochre above a lake that holds the last light, a family of crested cranes at the water's edge, an acacia in silhouette and a single bright star above the ridge.