March 2, 2026

Zero copies, infinite comments

The inner workings of TCP zero-copy

Speed freaks cheer, ops sweat: Linux cuts a copy

TLDR: Linux can send data without duplicating it, and io_uring adds an easier way to do it without waiting. Commenters are split between speed hype and maintenance anxiety, arguing over hardware support and the harder receive side where apps must pre-register memory and wait for kernel notifications.

TCP zero-copy—skipping that extra data duplicate between app memory and the kernel—has fans and foes sharpening their keyboards. Send-side zero-copy has existed since 2017 via the MSG_ZEROCOPY flag, which lets the kernel ship data straight from your buffer. Skeptics warn it’s a “footgun,” because you must keep your data untouched until the kernel sends a “you can reuse this” notification. The vibe is half victory lap, half “hold my pager” over whether this actually saves pain in real life.

Enter io_uring, Linux’s async engine, now with a zero‑copy send. Speed lovers call it “rocket fuel.” Ops folks roll eyes at polling the error queue and juggling notifications. The thread ignites over hardware gotchas: if your network card can’t do scatter‑gather (grabbing pieces from different places), the kernel silently copies anyway. Accusations fly—“benchmark cosplay” vs. boring production reality—with GIFs of blazing race cars hitting potholes.

Receive‑side zero‑copy, the trickier beast, stirs the biggest brawl. It wants memory registration (apps promise space ready for incoming data) so the kernel can drop payloads straight in while still reading headers. Commenters trade memes: “Hands off the cookie jar until Linux says ‘done’,” and “io_uring sounds like jewelry, but it’s handcuffs.” Links to kernel docs fly, brave souls post code, and the rest watch with popcorn.

Key Points

  • Linux’s TCP zero-copy avoids extra kernel-to-user/device data copies to reduce overhead.
  • Send-side zero-copy was introduced in 2017 via MSG_ZEROCOPY used with sendmsg() and iovec buffers.
  • The kernel references userspace buffers in skb structures and builds TCP headers in a separate kernel buffer.
  • Zero-copy send requires network hardware with scatter-gather DMA; otherwise the kernel falls back to copying.
  • Completion is asynchronous: applications get buffer reuse notifications via the socket error queue or io_uring completions.

Hottest takes

"Fast is free when you stop copying—ship it" — packetPunk
"Async + networking = pager at 3 a.m.; hard pass" — opsOverlord
"Zero-copy receive? Babysit buffers or get bit" — ringMyBell
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.