[PATCH v7 7/8] sched: add SD_BALANCE_NEWIDLE at MC and CPU level for sched_mc>0

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Vaidyanathan Srinivasan
Date: Thursday, December 18, 2008 - 10:56 am

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>
---

 include/linux/sched.h    |   13 +++++++++++++
 include/linux/topology.h |    6 ++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 5fe906b..07348ff 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -793,6 +793,19 @@ static inline int sd_balance_for_package_power(void)
 	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 *next;	/* Must be a circular list */
diff --git a/include/linux/topology.h b/include/linux/topology.h
index 7f10439..1628b43 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -125,7 +125,8 @@ void arch_update_cpu_topology(void);
 				| SD_WAKE_AFFINE	\
 				| SD_WAKE_BALANCE	\
 				| SD_SHARE_PKG_RESOURCES\
-				| sd_balance_for_mc_power(),\
+				| sd_balance_for_mc_power()\
+				| sd_power_saving_flags(),\
 	.last_balance		= jiffies,		\
 	.balance_interval	= 1,			\
 }
@@ -150,7 +151,8 @@ void arch_update_cpu_topology(void);
 				| SD_BALANCE_FORK	\
 				| SD_WAKE_AFFINE	\
 				| SD_WAKE_BALANCE	\
-				| sd_balance_for_package_power(),\
+				| sd_balance_for_package_power()\
+				| sd_power_saving_flags(),\
 	.last_balance		= jiffies,		\
 	.balance_interval	= 1,			\
 }

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v7 0/8] Tunable sched_mc_power_savings=n, Vaidyanathan Srinivasan, (Thu Dec 18, 10:55 am)
[PATCH v7 1/8] sched: convert BALANCE_FOR_xx_POWER to inli ..., Vaidyanathan Srinivasan, (Thu Dec 18, 10:56 am)
[PATCH v7 2/8] sched: Framework for sched_mc/smt_power_sav ..., Vaidyanathan Srinivasan, (Thu Dec 18, 10:56 am)
[PATCH v7 3/8] sched: favour lower logical cpu number for ..., Vaidyanathan Srinivasan, (Thu Dec 18, 10:56 am)
[PATCH v7 4/8] sched: nominate preferred wakeup cpu, Vaidyanathan Srinivasan, (Thu Dec 18, 10:56 am)
[PATCH v7 5/8] sched: bias task wakeups to preferred semi- ..., Vaidyanathan Srinivasan, (Thu Dec 18, 10:56 am)
[PATCH v7 6/8] sched: activate active load balancing in ne ..., Vaidyanathan Srinivasan, (Thu Dec 18, 10:56 am)
[PATCH v7 7/8] sched: add SD_BALANCE_NEWIDLE at MC and CPU ..., Vaidyanathan Srinivasan, (Thu Dec 18, 10:56 am)
[PATCH v7 8/8] sched: idle_balance() does not call load_ba ..., Vaidyanathan Srinivasan, (Thu Dec 18, 10:56 am)
Re: [PATCH v7 4/8] sched: nominate preferred wakeup cpu, Balbir Singh, (Thu Dec 18, 11:12 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Ingo Molnar, (Thu Dec 18, 1:19 pm)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Ingo Molnar, (Thu Dec 18, 1:31 pm)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Vaidyanathan Srinivasan, (Fri Dec 19, 1:24 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Vaidyanathan Srinivasan, (Fri Dec 19, 1:29 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Vaidyanathan Srinivasan, (Fri Dec 19, 6:34 am)
Re: [PATCH v7 4/8] sched: nominate preferred wakeup cpu, Andrew Morton, (Fri Dec 19, 2:55 pm)
Re: [PATCH v7 4/8] sched: nominate preferred wakeup cpu, Andrew Morton, (Fri Dec 19, 3:19 pm)
Re: [PATCH v7 4/8] sched: nominate preferred wakeup cpu, Andrew Morton, (Fri Dec 19, 3:38 pm)
Re: [PATCH v7 4/8] sched: nominate preferred wakeup cpu, Vaidyanathan Srinivasan, (Fri Dec 19, 9:36 pm)
Re: [PATCH v7 4/8] sched: nominate preferred wakeup cpu, Andrew Morton, (Fri Dec 19, 9:44 pm)
Re: [PATCH v7 4/8] sched: nominate preferred wakeup cpu, Ingo Molnar, (Sat Dec 20, 12:54 am)
Re: [PATCH v7 4/8] sched: nominate preferred wakeup cpu, Vaidyanathan Srinivasan, (Sat Dec 20, 3:02 am)
Re: [PATCH v7 4/8] sched: nominate preferred wakeup cpu, Vaidyanathan Srinivasan, (Sat Dec 20, 3:36 am)
Re: [PATCH v7 4/8] sched: nominate preferred wakeup cpu, Vaidyanathan Srinivasan, (Sat Dec 20, 3:56 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, MinChan Kim, (Mon Dec 29, 4:43 pm)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Balbir Singh, (Mon Dec 29, 7:48 pm)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Ingo Molnar, (Mon Dec 29, 11:21 pm)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Balbir Singh, (Mon Dec 29, 11:44 pm)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Ingo Molnar, (Tue Dec 30, 12:20 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Vaidyanathan Srinivasan, (Tue Dec 30, 10:31 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Vaidyanathan Srinivasan, (Tue Dec 30, 11:07 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Vaidyanathan Srinivasan, (Fri Jan 2, 12:26 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Ingo Molnar, (Fri Jan 2, 3:16 pm)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Mike Galbraith, (Sat Jan 3, 12:29 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Vaidyanathan Srinivasan, (Sat Jan 3, 3:16 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Mike Galbraith, (Sat Jan 3, 4:22 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Mike Galbraith, (Sun Jan 4, 8:00 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Vaidyanathan Srinivasan, (Sun Jan 4, 11:19 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Mike Galbraith, (Sun Jan 4, 12:52 pm)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Vaidyanathan Srinivasan, (Sun Jan 4, 8:20 pm)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Mike Galbraith, (Sun Jan 4, 9:40 pm)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Mike Galbraith, (Sun Jan 4, 11:36 pm)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Mike Galbraith, (Mon Jan 5, 8:19 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Mike Galbraith, (Tue Jan 6, 2:31 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Vaidyanathan Srinivasan, (Tue Jan 6, 7:54 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Vaidyanathan Srinivasan, (Tue Jan 6, 8:07 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Mike Galbraith, (Tue Jan 6, 10:48 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Balbir Singh, (Tue Jan 6, 11:45 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Mike Galbraith, (Wed Jan 7, 1:59 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Vaidyanathan Srinivasan, (Wed Jan 7, 4:26 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Mike Galbraith, (Wed Jan 7, 7:36 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Vaidyanathan Srinivasan, (Wed Jan 7, 8:35 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Mike Galbraith, (Thu Jan 8, 1:06 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Vaidyanathan Srinivasan, (Thu Jan 8, 10:46 am)
Re: [PATCH v7 0/8] Tunable sched_mc_power_savings=n, Mike Galbraith, (Thu Jan 8, 11:00 pm)