[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] cpuidle: Add decaying history logic to menu idle predictor



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1259157977 0
# Node ID c9b3fb7684e6d850b38a241d833528a0ac44905f
# Parent  d53db6af369f6ba8f89aa038999eccaf10c0416e
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/arch/x86/acpi/cpuidle_menu.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletion(-)

diff -r d53db6af369f -r c9b3fb7684e6 xen/arch/x86/acpi/cpuidle_menu.c
--- a/xen/arch/x86/acpi/cpuidle_menu.c  Wed Nov 25 14:05:28 2009 +0000
+++ b/xen/arch/x86/acpi/cpuidle_menu.c  Wed Nov 25 14:06:17 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.