Session

A new lightweight Zero-Copy Notification Mechanism in Linux

Speakers

Zijian Zhang
Xiaochun Lu

Label

Nuts and Bolts

Session Type

Talk

Contents

Description

The quest for optimizing network performance in high-throughput environments continually evolves with technological advancements. One promising avenue is zero-copy, a technique that significantly reduces CPU usage and boosts throughput. Currently, Linux offers various copy avoidance mechanisms, such as sendfile, vmsplice, and a more generic socket solution MSG_ZEROCOPY flag.

However, despite these benefits, the complexity of zero-copy prevents it from gaining broader adoption. This complexity largely stems from the need for significant changes in application architecture and the substantial overhead linked to its notification systems. This talk introduces a novel approach that integrates zero-copy more seamlessly into Linux systems. It achieves this by embedding notification mechanisms directly within the user arguments through the sendmsg control message. The new mechanism will not introduce extra system calls. It minimizes the overhead of receiving notifications while maintaining compatibility with the POSIX socket interface.

We update selftests/msg_zerocopy.c to accommodate our new method, and do the performance evaluation. When compared with MSG_ZEROCOPY flag, there is a 7% performance increase for TCP.

This session will dive into technical implementation, challenges overcome, and the implications for future zerocopy network application development.

https://lore.kernel.org/all/20240708210405.870930-1-zijianzhang@bytedance.com/