]> xenbits.xensource.com Git - xen.git/commitdiff
xen: credit2: avoid calling __update_svc_load() multiple times on the same vcpu
authorDario Faggioli <dario.faggioli@citrix.com>
Wed, 6 Jul 2016 16:37:37 +0000 (17:37 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Fri, 8 Jul 2016 10:04:48 +0000 (11:04 +0100)
by not resetting the variable that should guard against
that at the beginning of each step of the outer loop.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/common/sched_credit2.c

index 5e6dd7572c8767c38cca59f52b378c66c6a69265..8b95a47f045b25655e953e48e63e5469171e9f04 100644 (file)
@@ -1366,6 +1366,7 @@ 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;
     struct list_head *push_iter, *pull_iter;
+    bool_t inner_load_updated = 0;
 
     balance_state_t st = { .best_push_svc = NULL, .best_pull_svc = NULL };
     
@@ -1463,7 +1464,6 @@ retry:
     /* Reuse load delta (as we're trying to minimize it) */
     list_for_each( push_iter, &st.lrqd->svc )
     {
-        int inner_load_updated = 0;
         struct csched2_vcpu * push_svc = list_entry(push_iter, struct csched2_vcpu, rqd_elem);
 
         __update_svc_load(ops, push_svc, 0, now);
@@ -1475,10 +1475,8 @@ retry:
         {
             struct csched2_vcpu * pull_svc = list_entry(pull_iter, struct csched2_vcpu, rqd_elem);
             
-            if ( ! inner_load_updated )
-            {
+            if ( !inner_load_updated )
                 __update_svc_load(ops, pull_svc, 0, now);
-            }
         
             if ( !vcpu_is_migrateable(pull_svc, st.lrqd) )
                 continue;