Linux 6.1 To Allow Faster File Sharing Between Host & Guests With 9P VirtIO Optimization

Written by Michael Larabel in Virtualization on 14 October 2022 at 05:42 AM EDT. 11 Comments
VIRTUALIZATION
The 9P network protocol is commonly used -- such as with QEMU's 9pfs pass-through file-system -- for being able to share certain directories/files on host machines with the guest operating systems. With Linux 6.1 the 9p code has seen a nice set of optimizations that can allow for faster communication between the host and guest(s).

Merged this week were the net/9p updates for the Linux 6.1 kernel. With this new feature material is support for allocating smaller buffers for most metadata requests. Dominique Martinet noted that 9p would allocate large buffers even if just needing 4~8k sized buffers for metadata. In turn this support for allocating smaller buffers where appropriate can lead to some "nice performance improvements."
So far 'msize' was simply used for all 9p message types, which is far too much and slowed down performance tremendously with large values for user configurable 'msize' option.

Let's stop this waste by using the new p9_msg_buf_size() function for allocating more appropriate, smaller buffers according to what is actually sent over the wire.

Only exception: RDMA transport is currently excluded from this message size optimization - for its response buffers that is - as RDMA transport would not cope with it, due to its response buffers being pulled from a shared pool.

Christian Schoenebeck of Crudebyte took care of the underlying kernel code changes to address 9p's 500k "msize" limitation in the VirtIO transport path to allow for the smaller buffers.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week