Only select once per-main_loop iteration
commit839b2fe2b72c344187ae0d2cef993b8b8ef3c9bf
authorAnthony Liguori <aliguori@us.ibm.com>
Wed, 7 May 2008 16:55:49 +0000 (7 11:55 -0500)
committerAvi Kivity <avi@qumranet.com>
Thu, 8 May 2008 17:38:25 +0000 (8 20:38 +0300)
tree0413ee7fa2850ba7f6a289407e24863a47523a14
parentc9ab59fc120098574cbe3975e1878e818e5d5186
Only select once per-main_loop iteration

QEMU is rather aggressive about exhausting the wait period when selecting.
This is fine when the wait period is low and when there is significant delays
in-between selects as it improves IO throughput.

With the IO thread, there is a very small delay between selects and our wait
period for select is very large.  This patch changes main_loop_wait to only
select once before doing the various other things in the main loop.  This
generally improves responsiveness of things like SDL but also improves
individual file descriptor throughput quite dramatically.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
qemu-kvm.c
qemu-kvm.h
vl.c