User-mode network gateway (SLIRP / vpnkit) in pure OCaml
0

Configure Feed

Select the types of activity you want to include in your feed.

slirp: E42 records the write-offload win at P1

The systhread socket write beat every adjacent control in two
interleaved P1 brackets and is neutral at P2, with the teardown EPIPE
escape found and fixed along the way. The knob stays opt-in until one
quiet P2 leg confirms the neutrality; the same window's defaults
re-baseline is recorded beside it.

+35 -2
+35 -2
PROFILING.md
··· 60 60 the measured blocker; separate writer executors and pre-copy offload both 61 61 delay credits and regress throughput (E23--E27). The guest's TSQ allowance 62 62 is now a knob (E36; the pinned kernel's default is 4 MiB, eight full 63 - frames, not the 1 MiB E26 assumed), which unblocks re-testing the E20 64 - two-domain split. The transmit watchdog (E37) was localised to a lost 63 + frames, not the 1 MiB E26 assumed). E20's overlap landed as the systhread 64 + write offload and won P1 in two interleaved brackets (+3 to +12 percent 65 + against adjacent controls, neutral at P2); it stays opt-in until one 66 + quiet P2 leg confirms the neutrality (E42). The transmit watchdog (E37) was localised to a lost 65 67 avail kick after a pair quiesces (E40) and is FIXED by the bounded 66 68 Tx_pull walk: eighteen resumption cycles ran clean while the stranded 67 69 counter caught seven lost kicks (E41). ··· 1368 1370 visible: read it in every TX leg, and treat a jump after a macOS update 1369 1371 as the early warning. The dev-profile soak stands as the regression. 1370 1372 1373 + ### E42. The E20 overlap lands as a systhread write offload and wins P1 1374 + 1375 + - **Assumption.** E20's split does not need a second domain: offloading the 1376 + socket write to a systhread whose stub releases the runtime lock lets the 1377 + owning shard run its drain and TCP core while the kernel copies the batch 1378 + -- the same overlap with none of E27's scheduling latency, and a 1379 + discriminator for whether a full writer-domain split could add more. 1380 + - **Experiment.** `Eio_net_unix.Stream.offload_single_write` (vectored 1381 + writev, `Eio.Flow.single_write` semantics) behind `Splice.v 1382 + ?write_offload`, `--tcp-write-offload`, and `TCP_WRITE_OFFLOAD=1`; 1383 + vectored contract test pinned. Interleaved P1 and P2 brackets in the 1384 + campaign's cleanest window (loads 3.7-5.3, no process above 60%). 1385 + - **Result.** P1 offload beat every adjacent control in two independent 1386 + brackets: 71.55/74.55 against 62.06-70.81 controls (+7.1%/+11.6% versus 1387 + adjacent-control means), then after the teardown fix 65.84/67.71 against 1388 + 62.49-64.30 (+3.0%/+6.8%) -- the promotion gate passed both times. P2 is 1389 + neutral (61.70 against 61.09-61.40), as expected: two flows already 1390 + overlap each other across shards. The first bracket also exposed a real 1391 + bug: the raw stub surfaced teardown EPIPE as `Unix.Unix_error` where the 1392 + inline path reports `Eio.Io`, killing the gateway when a peer closed 1393 + with a batch in flight; the writer's reset handling now covers both 1394 + shapes, and a post-fix boot ran both legs with 61,390 offload writes and 1395 + zero uncaught exceptions. The same window's defaults re-baseline read 1396 + 41.95/42.87/41.98 at P16 receive and 61.09-67.73 at P2 transmit. 1397 + - **Iterate.** Keep `--tcp-write-offload` opt-in until one quiet P2 leg 1398 + confirms the neutrality, then flip the default: it wins the single-flow 1399 + regime and costs nothing at the operating point. A full writer-domain 1400 + split is now bounded: it can only improve on the offload by overlapping 1401 + the OCaml-side batch assembly too, and E27 prices its scheduling risk. 1402 + 1371 1403 ### Summary figure 1372 1404 1373 1405 ``` ··· 1686 1718 | E39 | the E38 survivors plus `IPERF_BLOCK=1M` and the E36 bracket, 21 interleaved fresh boots against defaults, `mediaanalysisd` SIGSTOPped; 2026-07-22 artifacts in `/tmp/vz-tsq-2026-07-22/quiet-legs/` | recipe | 1687 1719 | E40 | cross-read `vz.pair.N.tx_frames` snapshots against the guest interrupt tables in any watchdog boot's log; the resumption-pattern P1 soak (short legs, idle gaps) is the regression once the fix lands | recipe | 1688 1720 | E41 | dev-profile `STREAMS="1 1 1 1 1 1" ... 4 tx` boots; require zero guest `tx_errors` and read `vz.tx_stranded_catches`/`vz.tx_idle_polls` from the counters log; the Tx_pull contract is pinned in `ocaml-vz/test/test_vz_slirp.ml` | fixed + recipe | 1721 + | E42 | `TCP_WRITE_OFFLOAD=1` against the default in interleaved P1 brackets; read `tcp.splice.offload_writes` from the counters log | knob | 1689 1722 1690 1723 The complete environment-variable list, including 1691 1724 `VIRTIO_TX_LOAN_BUDGET`, is documented at the top of `bench/vz_bench.sh`.