From: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Indan Zupancic <indan@nul.nu>,
Youquan Song <youquan.song@intel.com>,
Ingo Molnar <mingo@elte.hu>,
Arjan van de Ven <arjan@linux.intel.com>,
Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [RFC PATCH v1 2/2] sched: fix group_capacity for thread level consolidation
Date: Mon, 16 Jan 2012 21:52:55 +0530 [thread overview]
Message-ID: <20120116162255.29759.6264.stgit@localhost> (raw)
In-Reply-To: <20120116161740.29759.4679.stgit@localhost>
sched_powersavings for threaded systems need this fix for
consolidation to sibling threads to work. Since threads have
fractional capacity, group_capacity will turn out to be one
always and not accommodate another task in the sibling thread.
This fix makes group_capacity a function of cpumask_weight that
will enable the power saving load balancer to pack tasks among
sibling threads and keep more cores idle.
Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
---
kernel/sched/fair.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index bae6ec8..c94e768 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4012,6 +4012,21 @@ static inline void update_sd_lb_stats(struct sched_domain *sd, int this_cpu,
*/
if (prefer_sibling && !local_group && sds->this_has_capacity)
sgs.group_capacity = min(sgs.group_capacity, 1UL);
+ /*
+ * If power savings balance is set at this domain, then
+ * make capacity equal to number of hardware threads to
+ * accommodate more tasks until capacity is reached.
+ */
+ else if (sd->flags & SD_POWERSAVINGS_BALANCE)
+ sgs.group_capacity =
+ cpumask_weight(sched_group_cpus(sg));
+
+ /*
+ * The default group_capacity is rounded from sum of
+ * fractional cpu_powers of sibling hardware threads
+ * in order to enable fair use of available hardware
+ * resources.
+ */
if (local_group) {
sds->this_load = sgs.avg_load;
next prev parent reply other threads:[~2012-01-16 16:23 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-16 16:22 [RFC PATCH v1 0/2] sched: unified sched_powersavings tunables Vaidyanathan Srinivasan
2012-01-16 16:22 ` [RFC PATCH v1 1/2] sched: unified sched_powersavings sysfs tunable Vaidyanathan Srinivasan
2012-01-25 14:53 ` Peter Zijlstra
2012-01-26 10:42 ` Jens Axboe
2012-01-26 11:08 ` Peter Zijlstra
2012-01-26 11:26 ` Jens Axboe
2012-01-26 12:04 ` Peter Zijlstra
2012-01-26 12:13 ` Jens Axboe
2012-01-26 12:39 ` Peter Zijlstra
2012-01-26 12:46 ` Jens Axboe
2012-01-28 12:06 ` [tip:sched/core] sched, block: Unify cache detection tip-bot for Peter Zijlstra
2012-01-27 9:35 ` [RFC PATCH v1 1/2] sched: unified sched_powersavings sysfs tunable Vaidyanathan Srinivasan
2012-01-25 14:57 ` Peter Zijlstra
2012-01-27 9:16 ` Vaidyanathan Srinivasan
2012-01-25 15:10 ` Peter Zijlstra
2012-01-25 15:12 ` Arjan van de Ven
2012-01-25 15:36 ` Peter Zijlstra
2012-01-27 9:22 ` Vaidyanathan Srinivasan
2012-01-27 9:40 ` Peter Zijlstra
2012-01-16 16:22 ` Vaidyanathan Srinivasan [this message]
2012-01-25 15:38 ` [RFC PATCH v1 2/2] sched: fix group_capacity for thread level consolidation Peter Zijlstra
2012-01-27 9:10 ` Vaidyanathan Srinivasan
2012-01-17 18:44 ` [RFC PATCH v1 0/2] sched: unified sched_powersavings tunables Vaidyanathan Srinivasan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120116162255.29759.6264.stgit@localhost \
--to=svaidy@linux.vnet.ibm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=arjan@linux.intel.com \
--cc=indan@nul.nu \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=suresh.b.siddha@intel.com \
--cc=vincent.guittot@linaro.org \
--cc=youquan.song@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.