Høiland-Jørgensen: The inner workings of TCP zero-copy
Toke Hoiland-Jorgensen has posted anoverview of how zero-copy networking works in the Linux kernel.
Since the memory is being copied directly from userspace to thenetwork device, the userspace application has to keep it aroundunmodified, until it has finished sending. The sendmsg()syscall itself is asynchronous, and will return without waiting forthis. Instead, once the memory buffers are no longer needed by thestack, the kernel will return a notification to userspace that thebuffers can be reused.