]> git.ipfire.org Git - thirdparty/qemu.git/commit - util/qemu-timer.c
qemu-timer: check active_timers outside lock/event
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 1 Dec 2016 08:58:02 +0000 (09:58 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 22 Dec 2016 15:00:24 +0000 (16:00 +0100)
commit8caa05d8891d0a09dc4c00908c24c6ddfd872bbe
tree477839f7d54f8b6657981cf242c622595ce9430f
parente7a9f35321a048922233c90f32e91d033faac176
qemu-timer: check active_timers outside lock/event

This avoids taking the active_timers_lock or resetting/setting the
timers_done_ev if there are no active timers.  This removes a small
(2-3%) source of overhead for dataplane.  The list is then checked
again inside the lock, or a NULL pointer could be dereferenced.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qemu-timer.c