direct-io.hg

changeset 12265:cb8eeadd8eae

[XEN] When balancing idlers per socket/core, do it one at a time.
Signed-off-by: Emmanuel Ackaouy <ack@xensource.com>
author Emmanuel Ackaouy <ack@xensource.com>
date Tue Nov 07 10:37:30 2006 +0000 (2006-11-07)
parents a174f9787014
children 0c332cf81e64
files xen/common/sched_credit.c
line diff
     1.1 --- a/xen/common/sched_credit.c	Tue Nov 07 10:19:20 2006 +0000
     1.2 +++ b/xen/common/sched_credit.c	Tue Nov 07 10:37:30 2006 +0000
     1.3 @@ -119,6 +119,7 @@
     1.4      _MACRO(steal_peer_best_idler)           \
     1.5      _MACRO(steal_loner_candidate)           \
     1.6      _MACRO(steal_loner_signal)              \
     1.7 +    _MACRO(cpu_pick)                        \
     1.8      _MACRO(dom_init)                        \
     1.9      _MACRO(dom_destroy)                     \
    1.10      _MACRO(vcpu_init)                       \
    1.11 @@ -722,6 +723,8 @@ csched_cpu_pick(struct vcpu *vc)
    1.12      cpumask_t cpus;
    1.13      int cpu, nxt;
    1.14  
    1.15 +    CSCHED_STAT_CRANK(cpu_pick);
    1.16 +
    1.17      /*
    1.18       * Pick from online CPUs in VCPU's affinity mask, giving a
    1.19       * preference to its current processor if it's in there.
    1.20 @@ -1186,6 +1189,7 @@ csched_load_balance(int cpu, struct csch
    1.21          peer_vcpu = per_cpu(schedule_data, peer_cpu).curr;
    1.22          spc = CSCHED_PCPU(peer_cpu);
    1.23  
    1.24 +        /* Signal the first candidate only. */
    1.25          if ( !is_idle_vcpu(peer_vcpu) &&
    1.26               is_idle_vcpu(__runq_elem(spc->runq.next)->vcpu) &&
    1.27               __csched_running_vcpu_is_stealable(cpu, peer_vcpu) )
    1.28 @@ -1195,11 +1199,10 @@ csched_load_balance(int cpu, struct csch
    1.29  
    1.30              CSCHED_STAT_CRANK(steal_loner_signal);
    1.31              cpu_raise_softirq(peer_cpu, SCHEDULE_SOFTIRQ);
    1.32 +            break;
    1.33          }
    1.34 -        else
    1.35 -        {
    1.36 -            spin_unlock(&per_cpu(schedule_data, peer_cpu).schedule_lock);
    1.37 -        }
    1.38 +
    1.39 +        spin_unlock(&per_cpu(schedule_data, peer_cpu).schedule_lock);
    1.40      }
    1.41  
    1.42      /* Failed to find more important work elsewhere... */