VT is comically slow
Quoted 10 lines · Anthony Liguori
...
Quoted 4 lines
We (Virtual Iron) are in a process of developing accelerated drivers for the HVM guests. Our goal for this effort is to get as close to native performance as possible and to make paravirtualization of guests unnecessary.
...
I don't think paravirtual drivers are necessary for good performance. There are a number of things about QEMU's device emulation that are less than ideal.
Before deciding to implement accelerated drivers for many different guest OSes, no trivial undertaking, we did quite a lot of analysis of QEMU and its capabilities. Our conclusion was that QEMU in the near future was not going to be able to reach performance goals that we set out for our product. Instead of hacking on QEMU in hope of getting better numbers out of it, we decided to design and implement accelerated drivers and the performance numbers we are getting proves that was the right decision to make. As I mentioned in my post before, these drvers will be freely available under GPL and everyone is welcome to use them.
Quoted 6 lines
...
Also, and I suspect this has more to do with your performance numbers, QEMU currently does disk IO via read()/write() syscalls on an fd that's open()'d withoutO_DIRECT. This means everything's going through the page cache.
The QEMU code that we use doesn't go through the dom0 buffer cache, we modified the code to use O_DIRECT. Can't user buffer cache and accelerated drivers (they go right to the disk) together, it can cause disk corruption. The performance numbers we get from this version of QEMU is still 4 to 6 times slower that native disk I/O.
Quoted 4 lines
I suspect that SCSI + linux-aio would result in close to native performance. Since SCSI is already in QEMU CVS, it's not that far off.
You might be right, however even with pipelining and async I/O, I don't think it is going to get close to native I/O numbers. I guess we'll just have to wait and see.
Quoted 2 lines
Best,
-Alex V.
Quoted 4 lines
The QEMU code that we use doesn't go through the dom0 buffer cache, we modified the code to use
O_DIRECT. Can't user buffer cache and accelerated drivers (they go right to the disk) together, it can cause disk corruption. The performance numbers we get from this version of QEMU is still 4 to 6 times slower that native disk I/O.
I doubt O_DIRECT buys you much in the way of performance -- as you say it's just a correctness thing. Still, the qemu block code is all completely synchronous -- the fact that you simply can't have more than a single outstanding block request at a time is going to seriously harm performance. As Anthony explained, some form of asynchronous IO in the qemu drivers would clearly improve performance.
Quoted 2 lines
You might be right, however even with pipelining and async I/O, I don't think it is going to get close to native I/O numbers. I guess we'll just have to wait and see.
I'd expect that disk can be made to perform reasonably well with qemu, using dma emulation and async IO. The old vmware workstation paper on device virtualization does a pretty good job of demonstrating that trap and emulate device access sucks, and would seem to imply that it's pretty unlikely to be practical for high-rate networking.
a.
[1] http://www.usenix.org/event/usenix01/sugerman/sugerman.pdf
Quoted 11 lines · alex
Quoted 5 lines · Anthony Liguori
...
Also, and I suspect this has more to do with your performance numbers, QEMU currently does disk IO via read()/write() syscalls on an fd that's open()'d withoutO_DIRECT. This means everything's going through the page cache.The QEMU code that we use doesn't go through the dom0 buffer cache, we modified the code to use
O_DIRECT. Can't user buffer cache and accelerated drivers (they go right to the disk) together, it can cause disk corruption. The performance numbers we get from this version of QEMU is still 4 to 6 times slower that native disk I/O.
Sorry, I should have been more clear. I presume that your drivers are a lot like the normal paravirt drivers. This means that you're injecting bio's into the host that point directly to the memory in the guest.
Just using O_DIRECT wouldn't be enough in QEMU. You would also have to have functioning DMA (which appears broken in Xen). Proper async support would help too.
Regards,
Anthony Liguori
Quoted 11 lines
Quoted 3 lines
I suspect that SCSI + linux-aio would result in close to native performance. Since SCSI is already in QEMU CVS, it's not that far off.
You might be right, however even with pipelining and async I/O, I don't think it is going to get close to native I/O numbers. I guess we'll just have to wait and see
Quoted 1 line
Best,
-Alex V.