public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Venkatesh Pallipadi <venki@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Gautham R Shenoy <ego@in.ibm.com>,
	Joel Schopp <jschopp@austin.ibm.com>,
	Suresh B Siddha <suresh.b.siddha@intel.com>,
	Michael Neuling <mikey@neuling.org>
Subject: Re: [PATCH] sched: Call update_group_power only for local_group
Date: Thu, 08 Jul 2010 16:12:16 +0200	[thread overview]
Message-ID: <1278598336.1900.150.camel@laptop> (raw)
In-Reply-To: <1278089799-11949-1-git-send-email-venki@google.com>

Sorry for the delay, I got side-tracked :/

On Fri, 2010-07-02 at 09:56 -0700, Venkatesh Pallipadi wrote:
> My fault. I completely missed that code path, assuming this_cpu in
> load_balance means this_cpu :(

Right, but local_group is still valid because that's
cpumask_test_cpu(this_cpu, sched_group_cpus(group));

So in that regard your initial patch was still correct. However, since
there can be multiple CPUs in the local group, we want to only have one
do the actual balancing, which is what the !*balance logic is about, so
by keeping the call site where it is gains that.

The below proposal avoids calling update_groups_power() too often for:
 - !local_groups,
 - multiple cpus in the same group.

Does this look correct?

Related to this, Mikey was looking at avoiding the for_each_cpu_and()
loops by converting update_sg_lb_stats into something similar to
update_group_power() and have 1 cpu in the group update the statistics
and propagate upwards by summing groups instead of individual cpus.

---
 kernel/sched_fair.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 9910e1b..62f34a0 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -2433,7 +2433,8 @@ static inline void update_sg_lb_stats(struct sched_domain *sd,
 		return;
 	}
 
-	update_group_power(sd, this_cpu);
+	if (local_group)
+		update_group_power(sd, this_cpu);
 
 	/* Adjust by relative CPU power of the group */
 	sgs->avg_load = (sgs->group_load * SCHED_LOAD_SCALE) / group->cpu_power;


  parent reply	other threads:[~2010-07-08 14:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01 23:12 [PATCH] sched: Call update_group_power only for local_group Venkatesh Pallipadi
2010-07-02  8:05 ` Peter Zijlstra
2010-07-02 16:20   ` Venkatesh Pallipadi
2010-07-02 16:40     ` Peter Zijlstra
2010-07-02 16:56       ` Venkatesh Pallipadi
2010-07-02 17:31         ` Peter Zijlstra
2010-07-08 14:12         ` Peter Zijlstra [this message]
2010-07-08 17:45           ` Suresh Siddha
2010-07-08 17:49             ` Peter Zijlstra
2010-07-08 17:50               ` Suresh Siddha
2010-07-08 17:55                 ` Peter Zijlstra
2010-07-08 18:16             ` Peter Zijlstra
2010-07-08 21:53               ` Suresh Siddha
2010-07-09 13:17                 ` Peter Zijlstra
2010-07-17 11:12                 ` [tip:sched/core] sched: Update rq->clock for nohz balanced cpus tip-bot for Suresh Siddha
2010-07-12 17:11               ` [PATCH] sched: Call update_group_power only for local_group Venkatesh Pallipadi
2010-07-17 11:12               ` [tip:sched/core] sched: Reduce update_group_power() calls tip-bot for Peter Zijlstra

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=1278598336.1900.150.camel@laptop \
    --to=peterz@infradead.org \
    --cc=ego@in.ibm.com \
    --cc=jschopp@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikey@neuling.org \
    --cc=suresh.b.siddha@intel.com \
    --cc=venki@google.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