Synchronous virtio-fs yields 30% better performance
Virtio devices normally work asynchronously: the guest submits a request, the host processes it, and an interrupt tells the guest that the result is ready. This gives the guest an opportunity to do something else while the device is busy. But what if the application is just waiting for that one request to finish?
That’s a common situation with filesystem operations, and the reason I’ve implemented experimental synchronous queues for virtio-fs in libkrun. The idea is to let the host thread running the vCPU process the request itself before returning to the guest.
In my tests, this brought a libkrunfw build down from 7m43s to 5m34s, improved synchronous random I/O throughput, and reduced average file deletion latency by 36.1%. Let’s look at the path we’re shortening.
