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] cpuidle: Fix for timer_deadline==0 case

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] cpuidle: Fix for timer_deadline==0 case
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 30 Apr 2009 06:40:14 -0700
Delivery-date: Thu, 30 Apr 2009 06:41:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1241082300 -3600
# Node ID ecf6277e0f6600f8537b1f3b616a06f28ed41484
# Parent  54dbd70406ad9b303505380fb893d1b3c928267b
cpuidle: Fix for timer_deadline==0 case

After the scheduler timer became suspended before entering cpu idle
state, the percpu timer_deadline is possible to be 0, i.e. no soft
timer in the queue. This case will cause unexpected large residency
percentage in C1 for the purely idle cpu.

Signed-off-by: Wei Gang <gang.wei@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/hpet.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff -r 54dbd70406ad -r ecf6277e0f66 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c       Thu Apr 30 09:43:29 2009 +0100
+++ b/xen/arch/x86/hpet.c       Thu Apr 30 10:05:00 2009 +0100
@@ -25,7 +25,7 @@
 #define HPET_EVT_USED_BIT    0
 #define HPET_EVT_USED       (1 << HPET_EVT_USED_BIT)
 #define HPET_EVT_DISABLE_BIT 1
-#define HPET_EVT_DISALBE    (1 << HPET_EVT_DISABLE_BIT)
+#define HPET_EVT_DISABLE    (1 << HPET_EVT_DISABLE_BIT)
 
 struct hpet_event_channel
 {
@@ -119,12 +119,12 @@ static int reprogram_hpet_evt_channel(
     int64_t delta;
     int ret;
 
-    if ( ch->flags & HPET_EVT_DISALBE )
+    if ( (ch->flags & HPET_EVT_DISABLE) || (expire == 0) )
         return 0;
 
     if ( unlikely(expire < 0) )
     {
-        printk(KERN_DEBUG "reprogram: expire < 0\n");
+        printk(KERN_DEBUG "reprogram: expire <= 0\n");
         return -ETIME;
     }
 
@@ -560,7 +560,7 @@ void hpet_broadcast_init(void)
         return;
     }
 
-    if ( legacy_hpet_event.flags & HPET_EVT_DISALBE )
+    if ( legacy_hpet_event.flags & HPET_EVT_DISABLE )
         return;
 
     hpet_id = hpet_read32(HPET_ID);
@@ -603,7 +603,7 @@ void hpet_disable_legacy_broadcast(void)
 
     spin_lock_irq(&legacy_hpet_event.lock);
 
-    legacy_hpet_event.flags |= HPET_EVT_DISALBE;
+    legacy_hpet_event.flags |= HPET_EVT_DISABLE;
 
     /* disable HPET T0 */
     cfg = hpet_read32(HPET_T0_CFG);
@@ -624,6 +624,9 @@ void hpet_broadcast_enter(void)
 {
     int cpu = smp_processor_id();
     struct hpet_event_channel *ch = per_cpu(cpu_bc_channel, cpu);
+
+    if ( this_cpu(timer_deadline) == 0 )
+        return;
 
     if ( !ch )
         ch = hpet_get_channel(cpu);

_______________________________________________
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] cpuidle: Fix for timer_deadline==0 case, Xen patchbot-unstable <=