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

[Xen-changelog] Fix the logic in vcpu_sleep_sync(): we must wait until



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 3a34bcb7c28b49877bbcf31fa3985ecb5651eae2
# Parent  fe5b84a24d43cc0f4726be16402e31538edb3a20
Fix the logic in vcpu_sleep_sync(): we must wait until
the running flag is cleared *and* the scheduler lock is
released. Not just one or the other.

Signed-off-by: Ryan Harper <ryanh@xxxxxxxxxx>

diff -r fe5b84a24d43 -r 3a34bcb7c28b xen/common/schedule.c
--- a/xen/common/schedule.c     Tue Sep 13 18:03:04 2005
+++ b/xen/common/schedule.c     Tue Sep 13 19:09:44 2005
@@ -211,11 +211,12 @@
 
     /*
      * We can be sure that the VCPU is finally descheduled after the running
-     * flag is cleared and the scheduler lock is released.
+     * flag is cleared and the scheduler lock is released. We also check that
+     * the domain continues to be unrunnable, in case someone else wakes it.
      */
-    while ( test_bit(_VCPUF_running, &v->vcpu_flags)
-            && !domain_runnable(v)
-            && spin_is_locked(&schedule_data[v->processor].schedule_lock) )
+    while ( !domain_runnable(v) &&
+            (test_bit(_VCPUF_running, &v->vcpu_flags) ||
+             spin_is_locked(&schedule_data[v->processor].schedule_lock)) )
         cpu_relax();
 
     sync_vcpu_execstate(v);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.