From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Pfeuffer Subject: Re: [PATCH] only set scheduler timer for non-idle CPU Date: Thu, 02 Apr 2009 14:48:28 +0200 Message-ID: <49D4B41C.9030901@mytum.de> References: <4D05DB80B95B23498C72C700BD6C2E0B12AB4586@pdsmsx502.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0368256718==" Return-path: In-Reply-To: <4D05DB80B95B23498C72C700BD6C2E0B12AB4586@pdsmsx502.ccr.corp.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Yu, Ke" , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --===============0368256718== Content-Type: multipart/alternative; boundary="------------080207090909020608050701" This is a multi-part message in MIME format. --------------080207090909020608050701 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 > Tian Kevin > >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 > > --------------080207090909020608050701 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit 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

--------------080207090909020608050701-- --===============0368256718== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0368256718==--