All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] only set scheduler timer for non-idle CPU
@ 2009-03-31  3:14 Yu, Ke
  2009-04-01 14:02 ` Tian, Kevin
  2009-04-02 12:48 ` Thomas Pfeuffer
  0 siblings, 2 replies; 6+ messages in thread
From: Yu, Ke @ 2009-03-31  3:14 UTC (permalink / raw)
  To: Keir Fraser; +Cc: Tian, Kevin, xen-devel@lists.xensource.com

[-- Attachment #1: Type: text/plain, Size: 722 bytes --]

It is not necessary to set scheduler timer for idle CPU. so this patch add conditional check for idle CPU.

This patch remove the last idle periodic timer in xen, thus enhance the idle average C state residency from two-digits ms to three-digit ms.

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) )
     {

[-- Attachment #2: sched.patch --]
[-- Type: application/octet-stream, Size: 750 bytes --]

PATCH: only set scheduler timer for non-idle CPU

It is not necessary to set scheduler timer for idle CPU. so this patch add conditional check for idle CPU.

This patch remove the last idle periodic timer in xen, thus enhance the idle average C state residency from two-digits ms to three-digit ms.

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) )
     {

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] only set scheduler timer for non-idle CPU
  2009-03-31  3:14 [PATCH] only set scheduler timer for non-idle CPU Yu, Ke
@ 2009-04-01 14:02 ` Tian, Kevin
  2009-04-02 12:48 ` Thomas Pfeuffer
  1 sibling, 0 replies; 6+ messages in thread
From: Tian, Kevin @ 2009-04-01 14:02 UTC (permalink / raw)
  To: Yu, Ke, Keir Fraser; +Cc: xen-devel@lists.xensource.com

[-- Attachment #1: Type: text/plain, Size: 946 bytes --]

Keir, how's your thought on below change? It makes sense even
not in power context. Ask here in case you didn't not it :-)

Thanks
Kevin 

>From: Yu, Ke 
>Sent: 2009年3月31日 11:14
>
>It is not necessary to set scheduler timer for idle CPU. so 
>this patch add conditional check for idle CPU.
>
>This patch remove the last idle periodic timer in xen, thus 
>enhance the idle average C state residency from two-digits ms 
>to three-digit ms.
>
>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) )
>     {
>

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] only set scheduler timer for non-idle CPU
  2009-03-31  3:14 [PATCH] only set scheduler timer for non-idle CPU Yu, Ke
  2009-04-01 14:02 ` Tian, Kevin
@ 2009-04-02 12:48 ` Thomas Pfeuffer
  2009-04-02 13:06   ` Keir Fraser
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Pfeuffer @ 2009-04-02 12:48 UTC (permalink / raw)
  To: Yu, Ke, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1157 bytes --]

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
>  
>


[-- Attachment #1.2: Type: text/html, Size: 1983 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] only set scheduler timer for non-idle CPU
  2009-04-02 12:48 ` Thomas Pfeuffer
@ 2009-04-02 13:06   ` Keir Fraser
  2009-04-02 13:18     ` Keir Fraser
  0 siblings, 1 reply; 6+ messages in thread
From: Keir Fraser @ 2009-04-02 13:06 UTC (permalink / raw)
  To: Thomas Pfeuffer, Yu, Ke, xen-devel@lists.xensource.com


[-- Attachment #1.1: Type: text/plain, Size: 753 bytes --]

On 02/04/2009 13:48, "Thomas Pfeuffer" <thomas.pfeuffer@mytum.de> wrote:

> 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.

It¹s probably cleaner always to respect the specific scheduler¹s scheduling
quantum in schedule.c, but then have sched_credit.c return a very large
quantum (large as possible) for the idle VCPU.

 -- Keir


[-- Attachment #1.2: Type: text/html, Size: 1513 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] only set scheduler timer for non-idle CPU
  2009-04-02 13:06   ` Keir Fraser
@ 2009-04-02 13:18     ` Keir Fraser
  2009-04-03  1:32       ` Yu, Ke
  0 siblings, 1 reply; 6+ messages in thread
From: Keir Fraser @ 2009-04-02 13:18 UTC (permalink / raw)
  To: Keir Fraser, Thomas Pfeuffer, Yu, Ke,
	xen-devel@lists.xensource.com

On 02/04/2009 14:06, "Keir Fraser" <keir.fraser@eu.citrix.com> wrote:

>> 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.
> 
> It¹s probably cleaner always to respect the specific scheduler¹s scheduling
> quantum in schedule.c, but then have sched_credit.c return a very large
> quantum (large as possible) for the idle VCPU.

I checked in something to this effect as c/s 19500.

 -- Keir

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] only set scheduler timer for non-idle CPU
  2009-04-02 13:18     ` Keir Fraser
@ 2009-04-03  1:32       ` Yu, Ke
  0 siblings, 0 replies; 6+ messages in thread
From: Yu, Ke @ 2009-04-03  1:32 UTC (permalink / raw)
  To: Keir Fraser, Thomas Pfeuffer, xen-devel@lists.xensource.com

>-----Original Message-----
>From: Keir Fraser [mailto:keir.fraser@eu.citrix.com]
>Sent: Thursday, April 02, 2009 9:19 PM
>To: Keir Fraser; Thomas Pfeuffer; Yu, Ke; xen-devel@lists.xensource.com
>Subject: Re: [Xen-devel] [PATCH] only set scheduler timer for non-idle CPU
>
>On 02/04/2009 14:06, "Keir Fraser" <keir.fraser@eu.citrix.com> wrote:
>
>>> 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.

I did not look into the much detail of the sedf-scheduler when making this patch. thanks for pointing it out, Thomas.

>>
>> It¹s probably cleaner always to respect the specific scheduler¹s scheduling
>> quantum in schedule.c, but then have sched_credit.c return a very large
>> quantum (large as possible) for the idle VCPU.
>
>I checked in something to this effect as c/s 19500.
>
> -- Keir
>

This change looks good to me. Thanks.

Best Regards
Ke

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-04-03  1:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-31  3:14 [PATCH] only set scheduler timer for non-idle CPU Yu, Ke
2009-04-01 14:02 ` Tian, Kevin
2009-04-02 12:48 ` Thomas Pfeuffer
2009-04-02 13:06   ` Keir Fraser
2009-04-02 13:18     ` Keir Fraser
2009-04-03  1:32       ` Yu, Ke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.