#
8205199d |
| 20-Apr-2012 |
Stefan Weil <sw@weilnetz.de> |
qemu-timer: Remove function alarm_has_dynticks
Some time ago, the last time which did not have dynticks was removed, so now all timers have dynticks.
I also removed a misleading error message for t
qemu-timer: Remove function alarm_has_dynticks
Some time ago, the last time which did not have dynticks was removed, so now all timers have dynticks.
I also removed a misleading error message for the dynticks timer. If timer_create fails, there is already an error message, and QEMU will use the unix timer which also provides dynamic ticks, therefore dynamic ticks are not disabled.
v2: Remove two if statements because they were always true (thanks to Paolo Bonzini for this correction).
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Weil <sw@weilnetz.de>
show more ...
|
#
5e1ec7b2 |
| 20-Apr-2012 |
Stefan Weil <sw@weilnetz.de> |
qemu-timer: Use bool, false, true for boolean values
This avoids conversions between int and bool / char.
It also makes the code more readable.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Sig
qemu-timer: Use bool, false, true for boolean values
This avoids conversions between int and bool / char.
It also makes the code more readable.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Weil <sw@weilnetz.de>
show more ...
|
#
c4879f2a |
| 20-Apr-2012 |
Stefan Weil <sw@weilnetz.de> |
qemu-timer: Remove unused function qemu_alarm_pending
The last user of this function was removed by commit 12d4536f7d911b6d87a766ad7300482ea663cea2.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
qemu-timer: Remove unused function qemu_alarm_pending
The last user of this function was removed by commit 12d4536f7d911b6d87a766ad7300482ea663cea2.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Weil <sw@weilnetz.de>
show more ...
|
#
bff9f8bf |
| 20-Apr-2012 |
Stefan Weil <sw@weilnetz.de> |
qemu-timer: Remove redundant include statements
qemu-timer.h includes qemu-common.h which already includes time.h, sys/time.h, windows.h, unistd.h, fcntl.h, errno.h and signal.h.
Therefore those in
qemu-timer: Remove redundant include statements
qemu-timer.h includes qemu-common.h which already includes time.h, sys/time.h, windows.h, unistd.h, fcntl.h, errno.h and signal.h.
Therefore those include statements are redundant and can be removed.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Weil <sw@weilnetz.de>
show more ...
|
#
7c7db755 |
| 13-Apr-2012 |
Stefano Stabellini <stefano.stabellini@eu.citrix.com> |
main_loop_wait: block indefinitely
- remove qemu_calculate_timeout;
- explicitly size timeout to uint32_t;
- introduce slirp_update_timeout;
- pass NULL as timeout argument to select in case time
main_loop_wait: block indefinitely
- remove qemu_calculate_timeout;
- explicitly size timeout to uint32_t;
- introduce slirp_update_timeout;
- pass NULL as timeout argument to select in case timeout is the maximum value;
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Paul Brook <paul@codesourcery.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|
#
4ffd16fc |
| 13-Apr-2012 |
Stefano Stabellini <stefano.stabellini@eu.citrix.com> |
qemu_next_alarm_deadline: check the expire time of a clock only if it is enabled
Also delta in qemu_next_alarm_deadline is a 64 bit value so set the default to INT64_MAX instead of INT32_MAX.
Signe
qemu_next_alarm_deadline: check the expire time of a clock only if it is enabled
Also delta in qemu_next_alarm_deadline is a 64 bit value so set the default to INT64_MAX instead of INT32_MAX.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|
#
5bfb723f |
| 13-Apr-2012 |
Stefano Stabellini <stefano.stabellini@eu.citrix.com> |
timers: the rearm function should be able to handle delta = INT64_MAX
Fix win32_rearm_timer and mm_rearm_timer: they should be able to handle INT64_MAX as a delta parameter without overflowing. Also
timers: the rearm function should be able to handle delta = INT64_MAX
Fix win32_rearm_timer and mm_rearm_timer: they should be able to handle INT64_MAX as a delta parameter without overflowing. Also, the next deadline in ms should be calculated rounding down rather than up (see unix_rearm_timer and dynticks_rearm_timer).
Finally ChangeTimerQueueTimer takes an unsigned long and timeSetEvent takes an unsigned int as delta, so cast the ms delta to the appropriate unsigned integer.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|
#
158fd3ce |
| 05-Apr-2012 |
Peter Portante <peter.portante@redhat.com> |
qemu-timer.c: Remove 250us timeouts
Basically, the main wait loop calls qemu_run_all_timers() unconditionally. The first thing this routine used to do is to see if a timer had been serviced, and the
qemu-timer.c: Remove 250us timeouts
Basically, the main wait loop calls qemu_run_all_timers() unconditionally. The first thing this routine used to do is to see if a timer had been serviced, and then reset the loop timeout to the next deadline.
However, the new deadlines had not been calculated at that point, as qemu_run_timers() had not been called yet for each of the clocks. So qemu_rearm_alarm_timer() would end up with a negative or zero deadline, and default to setting a 250us timeout for the loop.
As qemu_run_timers() is called for each clock, the real deadlines would be put in place, but because a loop timeout was already set, the loop timeout would not be changed.
Once that 250us timeout fired, the real deadline would be used for the subsequent timeout.
For idle VMs, this effectively doubles the number of times through the loop, doubling the number of select() system calls, timer calls, etc. putting added scheduling pressure on the kernel. And under cgroups, this really causes a big problem because the cgroup code does not scale well.
By simply running the timers before trying to rearm the timer, we always rearm with a non-zero deadline, effectively halving the number of system calls.
Signed-off-by: Peter Portante <pportant@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|
#
8156be56 |
| 28-Mar-2012 |
Paolo Bonzini <pbonzini@redhat.com> |
qtest: add clock management
This patch combines qtest and -icount together to turn the vm_clock into a source that can be fully managed by the client. To this end new commands clock_step and clock_
qtest: add clock management
This patch combines qtest and -icount together to turn the vm_clock into a source that can be fully managed by the client. To this end new commands clock_step and clock_set are added. Hooking them with libqtest is left as an exercise to the reader.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|
#
31552529 |
| 13-Jan-2012 |
Paolo Bonzini <pbonzini@redhat.com> |
notifier: switch to QLIST
Notifiers do not need to access both ends of the list, and using a QLIST also simplifies the API.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony
notifier: switch to QLIST
Notifiers do not need to access both ends of the list, and using a QLIST also simplifies the API.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|
#
36945d95 |
| 20-Jan-2012 |
Paolo Bonzini <pbonzini@redhat.com> |
remove #if 0 code for timers
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
|
#
cca5de73 |
| 09-Nov-2011 |
Paolo Bonzini <pbonzini@redhat.com> |
win32: remove broken timers
The non-dynticks timer variations are broken, so they can be removed.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.
win32: remove broken timers
The non-dynticks timer variations are broken, so they can be removed.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|
#
fbdc14eb |
| 27-Sep-2011 |
Paolo Bonzini <pbonzini@redhat.com> |
qemu-timer: do not use RunState change handlers
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
2ff68d07 |
| 12-Sep-2011 |
Paolo Bonzini <pbonzini@redhat.com> |
qemu-timer: move more stuff out of qemu-timer.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
4260a739 |
| 19-Sep-2011 |
Paolo Bonzini <pbonzini@redhat.com> |
qemu-timer: use atexit for quit_timers
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
a5c57d64 |
| 12-Sep-2011 |
Paolo Bonzini <pbonzini@redhat.com> |
qemu-timer: do not refer to runstate_is_running()
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
946fb27c |
| 12-Sep-2011 |
Paolo Bonzini <pbonzini@redhat.com> |
qemu-timer: move icount to cpus.c
None of this is needed by tools, and most of it can even be made static inside cpus.c.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
dc2dfcf0 |
| 12-Sep-2011 |
Paolo Bonzini <pbonzini@redhat.com> |
qemu-timer: more clock functions
These will be used when moving icount accounting to cpus.c.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
f3fc6e2e |
| 14-Mar-2011 |
Paolo Bonzini <pbonzini@redhat.com> |
qemu-timer: move common code to qemu_rearm_alarm_timer
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
688eb389 |
| 13-Sep-2011 |
Paolo Bonzini <pbonzini@redhat.com> |
qemu-timer: remove active_timers array
Embed the list in the QEMUClock instead.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
1354869c |
| 29-Jul-2011 |
Luiz Capitulino <lcapitulino@redhat.com> |
Drop the vm_running global variable
Use runstate_is_running() instead, which is introduced by this commit.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
|
#
1dfb4dd9 |
| 29-Jul-2011 |
Luiz Capitulino <lcapitulino@redhat.com> |
Replace the VMSTOP macros with a proper state type
Today, when notifying a VM state change with vm_state_notify(), we pass a VMSTOP macro as the 'reason' argument. This is not ideal because the VMST
Replace the VMSTOP macros with a proper state type
Today, when notifying a VM state change with vm_state_notify(), we pass a VMSTOP macro as the 'reason' argument. This is not ideal because the VMSTOP macros tell why qemu stopped and not exactly what the current VM state is.
One example to demonstrate this problem is that vm_start() calls vm_state_notify() with reason=0, which turns out to be VMSTOP_USER.
This commit fixes that by replacing the VMSTOP macros with a proper state type called RunState.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
show more ...
|
#
12d4536f |
| 22-Aug-2011 |
Anthony Liguori <aliguori@us.ibm.com> |
main: force enabling of I/O thread
Enabling the I/O thread by default seems like an important part of declaring 1.0. Besides allowing true SMP support with KVM, the I/O thread means that the TCG VC
main: force enabling of I/O thread
Enabling the I/O thread by default seems like an important part of declaring 1.0. Besides allowing true SMP support with KVM, the I/O thread means that the TCG VCPU doesn't have to multiplex itself with the I/O dispatch routines which currently requires a (racey) signal based alarm system.
I know there have been concerns about performance. I think so far the ones that have come up (virtio-net) are most likely due to secondary reasons like decreased batching.
I think we ought to force enabling I/O thread early in 1.0 development and commit to resolving any lingering issues.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|
#
7267c094 |
| 21-Aug-2011 |
Anthony Liguori <aliguori@us.ibm.com> |
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
#
d25f89c9 |
| 17-Jun-2011 |
Jan Kiszka <jan.kiszka@siemens.com> |
Register Linux dyntick timer as per-thread signal
Derived from kvm-tool patch http://thread.gmane.org/gmane.comp.emulators.kvm.devel/74309
Ingo Molnar pointed out that sending the timer signal to t
Register Linux dyntick timer as per-thread signal
Derived from kvm-tool patch http://thread.gmane.org/gmane.comp.emulators.kvm.devel/74309
Ingo Molnar pointed out that sending the timer signal to the whole process, just blocking it everywhere, is suboptimal with an increasing number of threads. QEMU is also using this pattern so far.
Linux provides a (non-portable) way to restrict the signal to a single thread: We can use SIGEV_THREAD_ID unless we are forced to emulate signalfd via an additional thread. That case could theoretically be optimized as well, but it doesn't look worth bothering.
Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|