WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [XEN] Small clean up.

# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID f5fd563bcc84f5bb67ceb1031c127ce44515507a
# Parent  1d3f52eb256e3522edc12daca91039b319dbbbe5
[XEN] Small clean up.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/common/schedule.c |   39 ++++++++++++++++-----------------------
 1 files changed, 16 insertions(+), 23 deletions(-)

diff -r 1d3f52eb256e -r f5fd563bcc84 xen/common/schedule.c
--- a/xen/common/schedule.c     Mon Sep 25 17:27:18 2006 +0100
+++ b/xen/common/schedule.c     Mon Sep 25 17:45:28 2006 +0100
@@ -41,7 +41,6 @@ static unsigned int opt_dom0_vcpus_pin;
 static unsigned int opt_dom0_vcpus_pin;
 boolean_param("dom0_vcpus_pin", opt_dom0_vcpus_pin);
 
-
 #define TIME_SLOP      (s32)MICROSECS(50)     /* allow time to slip a bit */
 
 /* Various timer handlers. */
@@ -104,35 +103,29 @@ void vcpu_runstate_get(struct vcpu *v, s
 
 int sched_init_vcpu(struct vcpu *v, unsigned int processor) 
 {
-    const struct domain * const d = v->domain;
-
-    /* Initialize processor and affinity settings. */
+    struct domain *d = v->domain;
+
+    /*
+     * Initialize processor and affinity settings. The idler, and potentially
+     * domain-0 VCPUs, are pinned onto their respective physical CPUs.
+     */
     v->processor = processor;
-
-    if ( is_idle_domain(d) || (d->domain_id == 0 && opt_dom0_vcpus_pin) )
-    {
-        /*
-         * The idler and potentially dom0 VCPUs are pinned onto their
-         * respective physical CPUs.
-         */
+    if ( is_idle_domain(d) || ((d->domain_id == 0) && opt_dom0_vcpus_pin) )
         v->cpu_affinity = cpumask_of_cpu(processor);
-
-        /* The idle VCPUs takes over their CPUs on creation... */
-        if ( is_idle_domain(d) )
-        {
-            per_cpu(schedule_data, v->processor).curr = v;
-            per_cpu(schedule_data, v->processor).idle = v;
-            set_bit(_VCPUF_running, &v->vcpu_flags);
-        }
-    }
     else
-    {
         v->cpu_affinity = CPU_MASK_ALL;
-    }
 
     /* Initialise the per-domain timers. */
     init_timer(&v->timer, vcpu_timer_fn, v, v->processor);
     init_timer(&v->poll_timer, poll_timer_fn, v, v->processor);
+
+    /* Idle VCPUs are scheduled immediately. */
+    if ( is_idle_domain(d) )
+    {
+        per_cpu(schedule_data, v->processor).curr = v;
+        per_cpu(schedule_data, v->processor).idle = v;
+        set_bit(_VCPUF_running, &v->vcpu_flags);
+    }
 
     TRACE_2D(TRC_SCHED_DOM_ADD, v->domain->domain_id, v->vcpu_id);
 
@@ -236,7 +229,7 @@ int vcpu_set_affinity(struct vcpu *v, cp
     cpumask_t online_affinity;
     unsigned long flags;
 
-    if ( v->domain->domain_id == 0 && opt_dom0_vcpus_pin )
+    if ( (v->domain->domain_id == 0) && opt_dom0_vcpus_pin )
         return -EINVAL;
 
     cpus_and(online_affinity, *affinity, cpu_online_map);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEN] Small clean up., Xen patchbot-unstable <=