diff mbox

[09/19] xen: credit2: avoid calling __update_svc_load() multiple times on the same vcpu

Message ID 146620514206.29766.13965940175057904519.stgit@Solace.fritz.box (mailing list archive)
State New, archived
Headers show

Commit Message

Dario Faggioli June 17, 2016, 11:12 p.m. UTC
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>
---
Cc: George Dunlap <george.dunlap@citrix.com>
Cc: Anshul Makkar <anshul.makkar@citrix.com>
Cc: David Vrabel <david.vrabel@citrix.com>
---
 xen/common/sched_credit2.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

George Dunlap July 6, 2016, 4:40 p.m. UTC | #1
On Sat, Jun 18, 2016 at 12:12 AM, Dario Faggioli
<dario.faggioli@citrix.com> wrote:
> 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>

Oops. :-/

Reviewed-by: George Dunlap <george.dunlap@citrix.com>

And queued.
diff mbox

Patch

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index af28e7b..c534f9c 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -1378,6 +1378,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 };
     
@@ -1478,7 +1479,6 @@  static void balance_load(const struct scheduler *ops, int cpu, s_time_t now)
     /* 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);
@@ -1490,10 +1490,8 @@  static void balance_load(const struct scheduler *ops, int cpu, s_time_t now)
         {
             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;