Hello Ke,
It is not necessary to set scheduler timer for idle CPU. so this patch add conditional check for idle CPU.
  
I think your patch is not good in case sedf-scheduler is used. If idle VCPU is the current "running" VCPU, the scheduler timer is set to the next "period begin" of the first VCPU in the wait queue.
Your patch prevents sedf from taking the VCPUs waiting for their next period into the runnable queue again.

Best regards,

Thomas

Signed-off-by:  Yu Ke <ke.yu@intel.com>
                Tian Kevin <kevin.tian@intel.com>

diff -r e4bfa70d587c xen/common/schedule.c
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -819,7 +819,10 @@ static void schedule(void)
 
     sd->curr = next;
     
-    set_timer(&sd->s_timer, now + r_time);
+    if ( !is_idle_vcpu(next) )
+    {
+        set_timer(&sd->s_timer, now + r_time);
+    }
 
     if ( unlikely(prev == next) )
     {
  

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