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

[Xen-changelog] [xen staging] xen: sched: Credit2: avoid looping too much (over runqueues) during load balancing



commit 07ee667d3b7a501a666a9c125996c0cfa12f165f
Author:     Dario Faggioli <dfaggioli@xxxxxxxx>
AuthorDate: Wed Nov 21 15:44:53 2018 +0000
Commit:     George Dunlap <george.dunlap@xxxxxxxxxx>
CommitDate: Wed Nov 21 15:44:53 2018 +0000

    xen: sched: Credit2: avoid looping too much (over runqueues) during load 
balancing
    
    For doing load balancing between runqueues, we check the load of each
    runqueue, select the one more "distant" than our own load, and then take
    the proper runq lock and attempt vcpu migrations.
    
    If we fail to take such lock, we try again, and the idea was to give up
    and bail if, during the checking phase, we can't take the lock of any
    runqueue (check the comment near to the 'goto retry;', in the middle of
    balance_load())
    
    However, the variable that controls the "give up and bail" part, is not
    reset upon retries. Therefore, provided we did manage to check the load of
    at least one runqueue during the first pass, if we can't get any runq lock,
    we don't bail, but we try again taking the lock of that same runqueue
    (and that may even more than once).
    
    Signed-off-by: Dario Faggioli <dfaggioli@xxxxxxxx>
    Reviewed-by: George Dunlap <george.dunlap@xxxxxxxxxx>
---
 xen/common/sched_credit2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 2ce577cf22..49a99c0a73 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -2554,7 +2554,7 @@ static bool vcpu_is_migrateable(struct csched2_vcpu *svc,
 static void balance_load(const struct scheduler *ops, int cpu, s_time_t now)
 {
     struct csched2_private *prv = csched2_priv(ops);
-    int i, max_delta_rqi = -1;
+    int i, max_delta_rqi;
     struct list_head *push_iter, *pull_iter;
     bool inner_load_updated = 0;
 
@@ -2573,6 +2573,7 @@ static void balance_load(const struct scheduler *ops, int 
cpu, s_time_t now)
     update_runq_load(ops, st.lrqd, 0, now);
 
 retry:
+    max_delta_rqi = -1;
     if ( !read_trylock(&prv->lock) )
         return;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging

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