]> xenbits.xensource.com Git - xen.git/commitdiff
xen: rtds: always clear the flag when replenishing a depleted vcpu
authorMeng Xu <mengxu@cis.upenn.edu>
Sat, 22 Oct 2016 02:12:02 +0000 (22:12 -0400)
committerWei Liu <wei.liu2@citrix.com>
Wed, 26 Oct 2016 12:40:01 +0000 (13:40 +0100)
We should clear the __RTDS_depleted bit once a VCPU budget is replenished.
Because repl_timer_handler may be called after rt_schedule
but before rt_context_saved, the VCPU may be not on CPU or on queue
when the VCPU is the middle of context switch

Signed-off-by: Meng Xu <mengxu@cis.upenn.edu>
Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
xen/common/sched_rt.c

index d95f79818f83d1503e368afaf472bc6d1837da89..d61804a1ce890743cba83e43f2f9eebc64c00653 100644 (file)
@@ -1480,8 +1480,8 @@ static void repl_timer_handler(void *data){
             if ( svc->cur_deadline > next_on_runq->cur_deadline )
                 runq_tickle(ops, next_on_runq);
         }
-        else if ( vcpu_on_q(svc) &&
-                  __test_and_clear_bit(__RTDS_depleted, &svc->flags) )
+        else if ( __test_and_clear_bit(__RTDS_depleted, &svc->flags) &&
+                  vcpu_on_q(svc) )
             runq_tickle(ops, svc);
 
         list_del(&svc->replq_elem);