ia64/xen-unstable

changeset 11624:f5fd563bcc84

[XEN] Small clean up.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Sep 25 17:45:28 2006 +0100 (2006-09-25)
parents 1d3f52eb256e
children 0f9908c2c5c7
files xen/common/schedule.c
line diff
     1.1 --- a/xen/common/schedule.c	Mon Sep 25 17:27:18 2006 +0100
     1.2 +++ b/xen/common/schedule.c	Mon Sep 25 17:45:28 2006 +0100
     1.3 @@ -41,7 +41,6 @@ string_param("sched", opt_sched);
     1.4  static unsigned int opt_dom0_vcpus_pin;
     1.5  boolean_param("dom0_vcpus_pin", opt_dom0_vcpus_pin);
     1.6  
     1.7 -
     1.8  #define TIME_SLOP      (s32)MICROSECS(50)     /* allow time to slip a bit */
     1.9  
    1.10  /* Various timer handlers. */
    1.11 @@ -104,36 +103,30 @@ void vcpu_runstate_get(struct vcpu *v, s
    1.12  
    1.13  int sched_init_vcpu(struct vcpu *v, unsigned int processor) 
    1.14  {
    1.15 -    const struct domain * const d = v->domain;
    1.16 -
    1.17 -    /* Initialize processor and affinity settings. */
    1.18 -    v->processor = processor;
    1.19 -
    1.20 -    if ( is_idle_domain(d) || (d->domain_id == 0 && opt_dom0_vcpus_pin) )
    1.21 -    {
    1.22 -        /*
    1.23 -         * The idler and potentially dom0 VCPUs are pinned onto their
    1.24 -         * respective physical CPUs.
    1.25 -         */
    1.26 -        v->cpu_affinity = cpumask_of_cpu(processor);
    1.27 +    struct domain *d = v->domain;
    1.28  
    1.29 -        /* The idle VCPUs takes over their CPUs on creation... */
    1.30 -        if ( is_idle_domain(d) )
    1.31 -        {
    1.32 -            per_cpu(schedule_data, v->processor).curr = v;
    1.33 -            per_cpu(schedule_data, v->processor).idle = v;
    1.34 -            set_bit(_VCPUF_running, &v->vcpu_flags);
    1.35 -        }
    1.36 -    }
    1.37 +    /*
    1.38 +     * Initialize processor and affinity settings. The idler, and potentially
    1.39 +     * domain-0 VCPUs, are pinned onto their respective physical CPUs.
    1.40 +     */
    1.41 +    v->processor = processor;
    1.42 +    if ( is_idle_domain(d) || ((d->domain_id == 0) && opt_dom0_vcpus_pin) )
    1.43 +        v->cpu_affinity = cpumask_of_cpu(processor);
    1.44      else
    1.45 -    {
    1.46          v->cpu_affinity = CPU_MASK_ALL;
    1.47 -    }
    1.48  
    1.49      /* Initialise the per-domain timers. */
    1.50      init_timer(&v->timer, vcpu_timer_fn, v, v->processor);
    1.51      init_timer(&v->poll_timer, poll_timer_fn, v, v->processor);
    1.52  
    1.53 +    /* Idle VCPUs are scheduled immediately. */
    1.54 +    if ( is_idle_domain(d) )
    1.55 +    {
    1.56 +        per_cpu(schedule_data, v->processor).curr = v;
    1.57 +        per_cpu(schedule_data, v->processor).idle = v;
    1.58 +        set_bit(_VCPUF_running, &v->vcpu_flags);
    1.59 +    }
    1.60 +
    1.61      TRACE_2D(TRC_SCHED_DOM_ADD, v->domain->domain_id, v->vcpu_id);
    1.62  
    1.63      return SCHED_OP(init_vcpu, v);
    1.64 @@ -236,7 +229,7 @@ int vcpu_set_affinity(struct vcpu *v, cp
    1.65      cpumask_t online_affinity;
    1.66      unsigned long flags;
    1.67  
    1.68 -    if ( v->domain->domain_id == 0 && opt_dom0_vcpus_pin )
    1.69 +    if ( (v->domain->domain_id == 0) && opt_dom0_vcpus_pin )
    1.70          return -EINVAL;
    1.71  
    1.72      cpus_and(online_affinity, *affinity, cpu_online_map);