From: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>,
Ingo Molnar <mingo@elte.hu>, Andrew Morton <akpm@osdl.org>,
lkml <linux-kernel@vger.kernel.org>,
steiner@sgi.com, dvhltc@us.ibm.com, mbligh@mbligh.org
Subject: Re: allow the load to grow upto its cpu_power (was Re: [Patch] don't kick ALB in the presence of pinned task)
Date: Thu, 11 Aug 2005 11:14:11 -0700 [thread overview]
Message-ID: <20050811111411.A581@unix-os.sc.intel.com> (raw)
In-Reply-To: <1123729750.5188.13.camel@npiggin-nld.site>; from nickpiggin@yahoo.com.au on Thu, Aug 11, 2005 at 01:09:10PM +1000
On Thu, Aug 11, 2005 at 01:09:10PM +1000, Nick Piggin wrote:
> I have a variation on the 2nd part of your patch which I think
> I would prefer. IMO it kind of generalises the current imbalance
> calculation to handle this case rather than introducing a new
> special case.
There is a difference between our changes.
When the system is lightly loaded, my patch minimizes the number of
groups picking up that load. This will help in power savings for
example in the context of CMP. There are more changes required
(user or kernel) for complete power savings, but this is a direction
towards that.
How about this patch?
--
Don't pull tasks from a group if that would cause the
group's total load to drop below its total cpu_power
(ie. cause the group to start going idle).
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Nick Piggin <npiggin@suse.de>
--- linux-2.6.13-rc5/kernel/sched.c~ 2005-08-09 13:30:19.067072328 -0700
+++ linux-2.6.13-rc5/kernel/sched.c 2005-08-11 09:29:55.937128384 -0700
@@ -1886,6 +1886,7 @@
{
struct sched_group *busiest = NULL, *this = NULL, *group = sd->groups;
unsigned long max_load, avg_load, total_load, this_load, total_pwr;
+ unsigned long excess_load, max_pull;
int load_idx;
max_load = this_load = total_load = total_pwr = 0;
@@ -1932,7 +1933,7 @@
group = group->next;
} while (group != sd->groups);
- if (!busiest || this_load >= max_load)
+ if (!busiest || this_load >= max_load || max_load <= SCHED_LOAD_SCALE)
goto out_balanced;
avg_load = (SCHED_LOAD_SCALE * total_load) / total_pwr;
@@ -1952,9 +1953,19 @@
* by pulling tasks to us. Be careful of negative numbers as they'll
* appear as very large values with unsigned longs.
*/
+
+ /* Don't want to pull so many tasks that a group would go idle */
+ excess_load = min(max_load - avg_load, max_load - SCHED_LOAD_SCALE);
+
+ if (this_load < SCHED_LOAD_SCALE)
+ /* pull as many tasks so that this group is fully utilized */
+ max_pull = max(avg_load - this_load, SCHED_LOAD_SCALE - this_load);
+ else
+ max_pull = avg_load - this_load;
+
/* How much load to actually move to equalise the imbalance */
- *imbalance = min((max_load - avg_load) * busiest->cpu_power,
- (avg_load - this_load) * this->cpu_power)
+ *imbalance = min(excess_load * busiest->cpu_power,
+ max_pull * this->cpu_power)
/ SCHED_LOAD_SCALE;
if (*imbalance < SCHED_LOAD_SCALE) {
next prev parent reply other threads:[~2005-08-11 18:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-02 0:42 [Patch] don't kick ALB in the presence of pinned task Siddha, Suresh B
2005-08-02 6:09 ` Nick Piggin
2005-08-02 9:43 ` Ingo Molnar
2005-08-02 10:06 ` Nick Piggin
2005-08-02 21:12 ` Siddha, Suresh B
2005-08-02 9:27 ` Ingo Molnar
2005-08-09 23:08 ` allow the load to grow upto its cpu_power (was Re: [Patch] don't kick ALB in the presence of pinned task) Siddha, Suresh B
2005-08-10 0:27 ` Nick Piggin
2005-08-10 2:03 ` Siddha, Suresh B
2005-08-11 3:09 ` Nick Piggin
2005-08-11 18:14 ` Siddha, Suresh B [this message]
2005-08-11 23:49 ` Nick Piggin
2005-08-12 0:39 ` Siddha, Suresh B
2005-08-12 1:24 ` Nick Piggin
2005-08-12 1:44 ` Siddha, Suresh B
2005-08-10 7:16 ` Ingo Molnar
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=20050811111411.A581@unix-os.sc.intel.com \
--to=suresh.b.siddha@intel.com \
--cc=akpm@osdl.org \
--cc=dvhltc@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbligh@mbligh.org \
--cc=mingo@elte.hu \
--cc=nickpiggin@yahoo.com.au \
--cc=steiner@sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox