[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-upstream-unstable] qtest: Fix deadloop by running main loop AIO context's timers



commit 987aba53db2e9e62e3f0ae0c22aa0381a735e282
Author:     Fam Zheng <famz@xxxxxxxxxx>
AuthorDate: Mon Jan 19 17:51:43 2015 +0800
Commit:     Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
CommitDate: Tue Feb 24 15:05:39 2015 -0600

    qtest: Fix deadloop by running main loop AIO context's timers
    
    qemu_clock_run_timers() only takes care of main_loop_tlg, we shouldn't
    forget aio timer list groups.
    
    Currently, the qemu_clock_deadline_ns_all (a few lines above) counts all
    the timergroups of this clock type, including aio tlg, but we don't fire
    them, so they are never cleared, which makes a dead loop.
    
    For example, this function hangs when trying to drive throttled block
    request queue with qtest clock_step.
    
    Signed-off-by: Fam Zheng <famz@xxxxxxxxxx>
    Acked-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
    Message-id: 1421661103-29153-1-git-send-email-famz@xxxxxxxxxx
    Signed-off-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
    (cherry picked from commit efef88b3d9ad4325172ed288032807fa88d683cc)
    Signed-off-by: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
---
 cpus.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/cpus.c b/cpus.c
index 0c33458..ff555e2 100644
--- a/cpus.c
+++ b/cpus.c
@@ -372,15 +372,19 @@ static void icount_warp_rt(void *opaque)
 void qtest_clock_warp(int64_t dest)
 {
     int64_t clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
+    AioContext *aio_context;
     assert(qtest_enabled());
+    aio_context = qemu_get_aio_context();
     while (clock < dest) {
         int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
         int64_t warp = qemu_soonest_timeout(dest - clock, deadline);
+
         seqlock_write_lock(&timers_state.vm_clock_seqlock);
         timers_state.qemu_icount_bias += warp;
         seqlock_write_unlock(&timers_state.vm_clock_seqlock);
 
         qemu_clock_run_timers(QEMU_CLOCK_VIRTUAL);
+        timerlist_run_timers(aio_context->tlg.tl[QEMU_CLOCK_VIRTUAL]);
         clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
     }
     qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.