high CPU load / async IO?
Hi,
sorry for bothering, but the last time i heard something about asyn IO was on Feb 2nd. Fabrice said:
[quote]
I have at least 5 items on my TODO list :
1) New kqemu which virtualizes both user and kernel code (currently in alpha stage but not released yet).
2) DMA block I/O (merged)
3) async block I/O (not merged yet)
4) Network adapter using DMA (not merged yet)
5) VGA acceleration (either improve Cirrus VGA or switch back to Bochs VGA for Win 2000/XP or Linux)
[/quote]
so 1) and 2) are in HEAD. I saw something concerning 5) too, i think. I'm not sure about 4) - but - well,
I'm very curious about 3) :-)
It's not in HEAD yet, isn't it?
Why i'm curious? Well, i'm curious about the improvement it causes. You people once told me, that the boost will not be that significant. On the other hand, i see my host CPU usage going towards 100% just because the guest is doing some IO or ... or is it because of somethine else perhaps?
To be concrete: have you guys ever run windows-update inside qemu? Well, my win2k guest consumes all CPU on the host for some reason. What might be the reason?
(qemu is started with -kernel-kqemu -m 256 -soundhw es1370)
Also windows-update's green "progress bar" inside the guest is stopping for let's say 3 or 5 seconds and not moving continuous.
Is anybody experiencing the same or knows the reason?
Thanks,
Sven
Quoted 3 lines · Sven Köhler
3) async block I/O (not merged yet)
It's not in HEAD yet, isn't it?
The pthread-based async patch is a band-aid. No doubt it helps your particular case, but it's not the right approach long term.
IDE only supports one outstanding request, so having a thread that runs the synchronous block routines appears reasonable. However, SATA and SCSI both support multiple outstanding requests. The extension to the existing patch would be simple--increase the number of threads.
A number of Xen hackers (primarily Andy Warfield and Dan Smith) have been doing a lot of work analyzing userspace block device performance. As QEMU's CPU virtualization gets faster (ala kqemu or VT/SVM), it will start facing the same bottlenecks that we do today in Xen.
To achieve near-native performance, you basically have to be able to saturate the host's IO scheduler queue. Using O_DIRECT, you can do zero-copy meaning that your ability to queue requests is the only limiting factor.
What's been discovered is that a thread based approach requires a ton of threads to achieve saturation. Just imagine the contention of having a very large number of threads trying to get at a single BDRVState.
The real solution is to modify the block API to be asynchronous and then provide support for interacting with the host IO scheduler queue via something like linux-aio (or the win32 equiv).
So the current thread-based async dma patch is really just the wrong long term solution. A more long term solution is likely in the works. It requires quite a bit of code modification though.
Regards,
Anthony Liguori
Quoted 1 line
Why i'm curious? Well, i'm curious about
the improvement it causes. You
Quoted 21 lines
people once told me, that the boost will not be that significant. On the other hand, i see my host CPU usage going towards 100% just because the guest is doing some IO or ... or is it because of somethine else perhaps?
To be concrete: have you guys ever run windows-update inside qemu? Well, my win2k guest consumes all CPU on the host for some reason. What might be the reason?
(qemu is started with -kernel-kqemu -m 256 -soundhw es1370)Also windows-update's green "progress bar" inside the guest is stopping for let's say 3 or 5 seconds and not moving continuous.
Is anybody experiencing the same or knows the reason?
Thanks,
Sven
_______________________________________________ Qemu-devel mailing list [email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
Quoted 10 lines
Quoted 2 lines
3) async block I/O (not merged yet)
It's not in HEAD yet, isn't it?The pthread-based async patch is a band-aid. No doubt it helps your particular case, but it's not the right approach long term.
IDE only supports one outstanding request, so having a thread that runs the synchronous block routines appears reasonable. However, SATA and SCSI both support multiple outstanding requests. The extension to the existing patch would be simple--increase the number of threads.
???
Wasn't there another variant using the async-I/O support of the Host OS and thereby supporting a larger number of outstanding requests?
Quoted 10 lines
A number of Xen hackers (primarily Andy Warfield and Dan Smith) have been doing a lot of work analyzing userspace block device performance. As QEMU's CPU virtualization gets faster (ala kqemu or VT/SVM), it will start facing the same bottlenecks that we do today in Xen.
To achieve near-native performance, you basically have to be able to saturate the host's IO scheduler queue. Using
O_DIRECT, you can do zero-copy meaning that your ability to queue requests is the only limiting factor.
Quoted 7 lines
What's been discovered is that a thread based approach requires a ton of threads to achieve saturation. Just imagine the contention of having a very large number of threads trying to get at a single BDRVState.
The real solution is to modify the block API to be asynchronous and then provide support for interacting with the host IO scheduler queue via something like linux-aio (or the win32 equiv).
The approch that i mentioned above (using the host's async I/O) is what you mean with using linux-aio, right?
Quoted 3 lines
So the current thread-based async dma patch is really just the wrong long term solution. A more long term solution is likely in the works. It requires quite a bit of code modification though.
I see. So in other words:
don't ask for simple async I/O now. The more complex and flexible sollution will follow soon.
Quoted 9 lines · Sven Köhler
Quoted 4 lines
IDE only supports one outstanding request, so having a thread that runs the synchronous block routines appears reasonable. However, SATA and SCSI both support multiple outstanding requests. The extension to the existing patch would be simple--increase the number of threads.
???
Wasn't there another variant using the async-I/O support of the Host OS and thereby supporting a larger number of outstanding requests?
Not that I know of. Do you have a pointer?
Quoted 2 lines
The approch that i mentioned above (using the host's async I/O) is what you mean with using linux-aio, right?
It depends on what you mean by the host's async I/O implementation.
Quoted 8 lines
Quoted 3 lines
So the current thread-based async dma patch is really just the wrong long term solution. A more long term solution is likely in the works. It requires quite a bit of code modification though.
I see. So in other words:
don't ask for simple async I/O now. The more complex and flexible sollution will follow soon.
Yes, hopefully really soon.
Regards,
Anthony Liguori
Quoted 4 lines
_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
Quoted 10 lines
Quoted 8 lines
Quoted 4 lines
IDE only supports one outstanding request, so having a thread that runs the synchronous block routines appears reasonable. However, SATA and SCSI both support multiple outstanding requests. The extension to the existing patch would be simple--increase the number of threads.
???
Wasn't there another variant using the async-I/O support of the Host OS and thereby supporting a larger number of outstanding requests?
Not that I know of. Do you have a pointer?
Hmm, perhaps i only heard people talking about it ... But if i find anything, i post the link.
Quoted 10 lines
Quoted 8 lines
Quoted 3 lines
So the current thread-based async dma patch is really just the wrong long term solution. A more long term solution is likely in the works. It requires quite a bit of code modification though.
I see. So in other words:
don't ask for simple async I/O now. The more complex and flexible sollution will follow soon.
Yes, hopefully really soon.
So i will wait patiently :-)
Quoted 4 lines · Sven Köhler
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
So the current thread-based async dma patch is really just the wrong long term solution. A more long term solution is likely in the works. It requires quite a bit of code modification though.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
I see. So in other words:
don't ask for simple async I/O now. The more complex and flexible sollution will follow soon.
Yes, hopefully really soon.
So i will wait patiently :-)
Is anyone actively working on this, or is it just speculation? I'd greatly prefer (and might do, if no one is working on it and Fabrice would take it) do a libaio version, since that'll for sure perform the best on Linux. But a posixaio version might be saner, as that should work on other operating systems as well.
Fabrice, can you let people know what you would prefer?
Signature · 1 line
Jens Axboe
Quoted 16 lines · Jens Axboe
Quoted 4 lines · Sven Köhler
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
So the current thread-based async dma patch is really just the wrong long term solution. A more long term solution is likely in the works. It requires quite a bit of code modification though.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
I see. So in other words:
don't ask for simple async I/O now. The more complex and flexible sollution will follow soon.
Yes, hopefully really soon.
So i will wait patiently :-)
Quoted 7 lines
Is anyone actively working on this, or is it just speculation? I'd greatly prefer (and might do, if no one is working on it and Fabrice would take it) do a libaio version, since that'll for sure perform the best on Linux. But a posixaio version might be saner, as that should work on other operating systems as well.
Fabrice, can you let people know what you would prefer?
I am working on an implementation and the first version will use the posix aio and possibly the Windows ReadFile/WriteFile overlapped I/Os. Anthony Liguori got a pre version of the code, but it is not commitable yet.
Fabrice.
Quoted 23 lines · Fabrice Bellard
Quoted 22 lines · Jens Axboe
Quoted 4 lines · Sven Köhler
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
So the current thread-based async dma patch is really just the wrong long term solution. A more long term solution is likely in the works. It requires quite a bit of code modification though.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
I see. So in other words:
don't ask for simple async I/O now. The more complex and flexible sollution will follow soon.
Yes, hopefully really soon.
So i will wait patiently :-)
Is anyone actively working on this, or is it just speculation? I'd greatly prefer (and might do, if no one is working on it and Fabrice would take it) do a libaio version, since that'll for sure perform the best on Linux. But a posixaio version might be saner, as that should work on other operating systems as well.
Quoted 6 lines
Quoted 1 line
Fabrice, can you let people know what you would prefer?
I am working on an implementation and the first version will use the posix aio and possibly the Windows ReadFile/WriteFile overlapped I/Os. Anthony Liguori got a pre version of the code, but it is not commitable yet.
Sounds good, so at least it's on its way :-)
It's on of those big items left on the TODO, so will be good to see go in. Then one should implement an ahci host controller for queued command support next...
Signature · 1 line
Jens Axboe
Quoted 6 lines · Paul Brook
Quoted 4 lines
Sounds good, so at least it's on its way :-)
It's on of those big items left on the TODO, so will be good to see go in. Then one should implement an ahci host controller for queued command support next...Or use the scsi emulation :-)
Ah, did not know that queueing was fully implemented there yet!
Signature · 1 line
Jens Axboe
Quoted 9 lines · Jens Axboe
Quoted 6 lines · Paul Brook
Quoted 4 lines
Sounds good, so at least it's on its way :-)
It's on of those big items left on the TODO, so will be good to see go in. Then one should implement an ahci host controller for queued command support next...Or use the scsi emulation :-)
Ah, did not know that queueing was fully implemented there yet!
It isn't, but it's nearer than the SATA emulation!
Paul
Quoted 4 lines
Sounds good, so at least it's on its way :-)
It's on of those big items left on the TODO, so will be good to see go in. Then one should implement an ahci host controller for queued command support next...
Or use the scsi emulation :-)
Paul
Quoted 7 lines · Paul Brook
Quoted 6 lines · Jens Axboe
Quoted 5 lines · Paul Brook
Quoted 4 lines
Sounds good, so at least it's on its way :-)
It's on of those big items left on the TODO, so will be good to see go in. Then one should implement an ahci host controller for queued command support next...
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Or use the scsi emulation :-)
Ah, did not know that queueing was fully implemented there yet!
It isn't, but it's nearer than the SATA emulation!
ahci wouldn't be too much work, but definitely more so than finishing the scsi bits!
Signature · 1 line
Jens Axboe
Quoted 10 lines
Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
Sounds good, so at least it's on its way :-)
It's on of those big items left on the TODO, so will be good to see go in. Then one should implement an ahci host controller for queued command support next...Or use the scsi emulation :-)
Ah, did not know that queueing was fully implemented there yet!
It isn't, but it's nearer than the SATA emulation!
ahci wouldn't be too much work, but definitely more so than finishing the scsi bits!
That sounds great! I feel, like my dreams come true.
BTW: Fabrice said, he will use the POSIX AIO (i guess, he means
http://www.bullopensource.org/posix/ in case of Linux, right?)
Which other OS do also support the POSIX AIO API?
Quoted 8 lines · Sven Köhler
Quoted 8 lines
Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
Sounds good, so at least it's on its way :-)
It's on of those big items left on the TODO, so will be good to see go in. Then one should implement an ahci host controller for queued command support next...Or use the scsi emulation :-)
Ah, did not know that queueing was fully implemented there yet!
It isn't, but it's nearer than the SATA emulation!
Quoted 8 lines
Quoted 2 lines
ahci wouldn't be too much work, but definitely more so than finishing the scsi bits!
That sounds great! I feel, like my dreams come true.
BTW: Fabrice said, he will use the POSIX AIO (i guess, he means
http://www.bullopensource.org/posix/ in case of Linux, right?)
Well I would assume that he just would use the glibc posix aio, which is suboptimal but at least the code can be reused. The bull project looks like it's trying to mimic posix aio on top of linux aio, so (if they got the details right) that should be faster. I didn't check their sources, though. You should be able to use the bull stuff with qemu, it would most likely overloading the glibc function for posix aio.
Quoted 1 line
Which other OS do also support the POSIX AIO API?
No idea really, but I would guess any "unixy" OS out there.
Signature · 1 line
Jens Axboe