aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>2008-12-18 12:56:47 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-19 03:21:55 -0500
commit100fdaee70ebf5f31b9451fbc01300c627091328 (patch)
tree81493242ff99c8ba52163da5b44ffc51929622cf
parentad273b32e482cdef306eac32b28d97f513a022f4 (diff)
sched: add SD_BALANCE_NEWIDLE at MC and CPU level for sched_mc>0
Impact: change task balancing to save power more agressively Add SD_BALANCE_NEWIDLE flag at MC level and CPU level if sched_mc is set. This helps power savings and will not affect performance when sched_mc=0 Ingo and Mike Galbraith have optimised the SD flags by removing SD_BALANCE_NEWIDLE at MC and CPU level. This helps performance but hurts power savings since this slows down task consolidation by reducing the number of times load_balance is run. sched: fine-tune SD_MC_INIT commit 14800984706bf6936bbec5187f736e928be5c218 Author: Mike Galbraith <efault@gmx.de> Date: Fri Nov 7 15:26:50 2008 +0100 sched: re-tune balancing -- revert commit 9fcd18c9e63e325dbd2b4c726623f760788d5aa8 Author: Ingo Molnar <mingo@elte.hu> Date: Wed Nov 5 16:52:08 2008 +0100 This patch selectively enables SD_BALANCE_NEWIDLE flag only when sched_mc is set to 1 or 2. This helps power savings by task consolidation and also does not hurt performance at sched_mc=0 where all power saving optimisations are turned off. Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--include/linux/sched.h13
-rw-r--r--include/linux/topology.h6
2 files changed, 17 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index a96726658eca..5a933d925473 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -792,6 +792,19 @@ static inline int sd_balance_for_package_power(void)
792 return 0; 792 return 0;
793} 793}
794 794
795/*
796 * Optimise SD flags for power savings:
797 * SD_BALANCE_NEWIDLE helps agressive task consolidation and power savings.
798 * Keep default SD flags if sched_{smt,mc}_power_saving=0
799 */
800
801static inline int sd_power_saving_flags(void)
802{
803 if (sched_mc_power_savings | sched_smt_power_savings)
804 return SD_BALANCE_NEWIDLE;
805
806 return 0;
807}
795 808
796struct sched_group { 809struct sched_group {
797 struct sched_group *next; /* Must be a circular list */ 810 struct sched_group *next; /* Must be a circular list */
diff --git a/include/linux/topology.h b/include/linux/topology.h
index 0ce7c0dac06c..e632d29f0544 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -125,7 +125,8 @@ int arch_update_cpu_topology(void);
125 | SD_WAKE_AFFINE \ 125 | SD_WAKE_AFFINE \
126 | SD_WAKE_BALANCE \ 126 | SD_WAKE_BALANCE \
127 | SD_SHARE_PKG_RESOURCES\ 127 | SD_SHARE_PKG_RESOURCES\
128 | sd_balance_for_mc_power(),\ 128 | sd_balance_for_mc_power()\
129 | sd_power_saving_flags(),\
129 .last_balance = jiffies, \ 130 .last_balance = jiffies, \
130 .balance_interval = 1, \ 131 .balance_interval = 1, \
131} 132}
@@ -150,7 +151,8 @@ int arch_update_cpu_topology(void);
150 | SD_BALANCE_FORK \ 151 | SD_BALANCE_FORK \
151 | SD_WAKE_AFFINE \ 152 | SD_WAKE_AFFINE \
152 | SD_WAKE_BALANCE \ 153 | SD_WAKE_BALANCE \
153 | sd_balance_for_package_power(),\ 154 | sd_balance_for_package_power()\
155 | sd_power_saving_flags(),\
154 .last_balance = jiffies, \ 156 .last_balance = jiffies, \
155 .balance_interval = 1, \ 157 .balance_interval = 1, \
156} 158}