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-3.4-testing] cpuidle: Add decaying history logic to

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.4-testing] cpuidle: Add decaying history logic to menu idle predictor
From: "Xen patchbot-3.4-testing" <patchbot-3.4-testing@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 27 Nov 2009 00:40:51 -0800
Delivery-date: Fri, 27 Nov 2009 00:42:02 -0800
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 1259310547 0
# Node ID 5325327eada0d590bf27e252f25ec6683f988c95
# Parent  87ff5a18039d3932774887ec1fef473e5dc32918
cpuidle: Add decaying history logic to menu idle predictor

this patch is ported from linux upstream git commit
816bb611e41be29b476dc16f6297eb551bf4d747

the original description is:
"
Add decaying history of predicted idle time, instead of using the last
early wakeup. This logic helps menu governor do better job of
predicting idle time.

With this change, we also measured noticable (~8%) power savings on a
DP server system with CPUs supporting deep C states, when system was
lightly loaded. There was no change to power or perf on other load
conditions.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@xxxxxxxxx>
Signed-off-by: Len Brown <len.brown@xxxxxxxxx>
"

In Xen environment, we also observe this patch reduce the idle power
fluctuation.  In one DP server, when system is purely idle, the watts
stdev/average reduce from 6% to 2%. it is helpful for idle power
measurement accuracy.  There is no performance and power change when
system is loaded.

Signed-off-by: Yu Ke <ke.yu@xxxxxxxxx>
xen-unstable changeset:   20494:c9b3fb7684e6
xen-unstable date:        Wed Nov 25 14:06:17 2009 +0000
---
 xen/arch/x86/acpi/cpuidle_menu.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletion(-)

diff -r 87ff5a18039d -r 5325327eada0 xen/arch/x86/acpi/cpuidle_menu.c
--- a/xen/arch/x86/acpi/cpuidle_menu.c  Fri Nov 27 08:28:26 2009 +0000
+++ b/xen/arch/x86/acpi/cpuidle_menu.c  Fri Nov 27 08:29:07 2009 +0000
@@ -32,6 +32,7 @@
 #include <xen/cpuidle.h>
 
 #define BREAK_FUZZ      4       /* 4 us */
+#define PRED_HISTORY_PCT   50
 #define USEC_PER_SEC 1000000
 
 struct menu_device
@@ -39,6 +40,7 @@ struct menu_device
     int             last_state_idx;
     unsigned int    expected_us;
     unsigned int    predicted_us;
+    unsigned int    current_predicted_us;
     unsigned int    last_measured_us;
     unsigned int    elapsed_us;
 };
@@ -63,6 +65,12 @@ static int menu_select(struct acpi_proce
 
     /* determine the expected residency time */
     data->expected_us = get_sleep_length_us();
+
+    /* Recalculate predicted_us based on prediction_history_pct */
+    data->predicted_us *= PRED_HISTORY_PCT;
+    data->predicted_us += (100 - PRED_HISTORY_PCT) *
+        data->current_predicted_us;
+    data->predicted_us /= 100;
 
     /* find the deepest idle state that satisfies our constraints */
     for ( i = 2; i < power->count; i++ )
@@ -94,7 +102,7 @@ static void menu_reflect(struct acpi_pro
     measured_us = data->elapsed_us <= measured_us ? measured_us : -1;
 
     /* Predict time remaining until next break event */
-    data->predicted_us = max(measured_us, data->last_measured_us);
+    data->current_predicted_us = max(measured_us, data->last_measured_us);
 
     /* Distinguish between expected & non-expected events */
     if ( last_residency + BREAK_FUZZ

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.4-testing] cpuidle: Add decaying history logic to menu idle predictor, Xen patchbot-3.4-testing <=