Commit 100fdaee authored by Vaidyanathan Srinivasan's avatar Vaidyanathan Srinivasan Committed by Ingo Molnar

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 14800984
        Author: Mike Galbraith <efault@gmx.de>
        Date:   Fri Nov 7 15:26:50 2008 +0100

    sched: re-tune balancing -- revert
        commit 9fcd18c9
        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: default avatarVaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Acked-by: default avatarBalbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent ad273b32
...@@ -792,6 +792,19 @@ static inline int sd_balance_for_package_power(void) ...@@ -792,6 +792,19 @@ static inline int sd_balance_for_package_power(void)
return 0; return 0;
} }
/*
* Optimise SD flags for power savings:
* SD_BALANCE_NEWIDLE helps agressive task consolidation and power savings.
* Keep default SD flags if sched_{smt,mc}_power_saving=0
*/
static inline int sd_power_saving_flags(void)
{
if (sched_mc_power_savings | sched_smt_power_savings)
return SD_BALANCE_NEWIDLE;
return 0;
}
struct sched_group { struct sched_group {
struct sched_group *next; /* Must be a circular list */ struct sched_group *next; /* Must be a circular list */
......
...@@ -125,7 +125,8 @@ int arch_update_cpu_topology(void); ...@@ -125,7 +125,8 @@ int arch_update_cpu_topology(void);
| SD_WAKE_AFFINE \ | SD_WAKE_AFFINE \
| SD_WAKE_BALANCE \ | SD_WAKE_BALANCE \
| SD_SHARE_PKG_RESOURCES\ | SD_SHARE_PKG_RESOURCES\
| sd_balance_for_mc_power(),\ | sd_balance_for_mc_power()\
| sd_power_saving_flags(),\
.last_balance = jiffies, \ .last_balance = jiffies, \
.balance_interval = 1, \ .balance_interval = 1, \
} }
...@@ -150,7 +151,8 @@ int arch_update_cpu_topology(void); ...@@ -150,7 +151,8 @@ int arch_update_cpu_topology(void);
| SD_BALANCE_FORK \ | SD_BALANCE_FORK \
| SD_WAKE_AFFINE \ | SD_WAKE_AFFINE \
| SD_WAKE_BALANCE \ | SD_WAKE_BALANCE \
| sd_balance_for_package_power(),\ | sd_balance_for_package_power()\
| sd_power_saving_flags(),\
.last_balance = jiffies, \ .last_balance = jiffies, \
.balance_interval = 1, \ .balance_interval = 1, \
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment