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

[Xen-changelog] [xen master] xen: rtds: always clear the flag when replenishing a depleted vcpu



commit 1b843b2097e89d0fae18123cde88da9d167d9a0c
Author:     Meng Xu <mengxu@xxxxxxxxxxxxx>
AuthorDate: Fri Oct 21 22:12:02 2016 -0400
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Wed Oct 26 13:40:01 2016 +0100

    xen: rtds: always clear the flag when replenishing a depleted vcpu
    
    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@xxxxxxxxxxxxx>
    Acked-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
    Release-acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 xen/common/sched_rt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index d95f798..d61804a 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -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);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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