mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>,
	Alex Shi <alex.shi@intel.com>,
	Huang@programming.kicks-ass.net, Ying <ying.huang@intel.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: load balancing regression since commit 367456c7
Date: Tue, 17 Apr 2012 13:43:33 +0200	[thread overview]
Message-ID: <1334663013.28150.83.camel@twins> (raw)
In-Reply-To: <1334106376.19157.89.camel@schen9-DESK>

On Tue, 2012-04-10 at 18:06 -0700, Tim Chen wrote:
> Peter,
> 
> We noticed in a hackbench test (./hackbench 100 process 2000)
> on a Sandy bridge 2 socket server, there has been a slow down
> by a factor of 4 since commit 367456c7 was applied
> (sched: Ditch per cgroup task lists for load-balancing).
> 
> The commit 5d6523e (sched: Fix load-balance wreckage) did
> not fix the regression.
> 
> In the profile, there is heavy spin lock contention in the load_balance path of 3.4-rc2
> where it was less than .003% of cpu before commit 367456c7.

I can't actually reproduce but does the below help? 

If not, can you shoot your .config over?

---
 kernel/sched/fair.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 0d97ebd..e1da5c6 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3215,6 +3215,8 @@ static int move_one_task(struct lb_env *env)
 
 static unsigned long task_h_load(struct task_struct *p);
 
+static const unsigned int sched_nr_migrate_break = IS_ENABLED(CONFIG_PREEMPT) ? 8 : 32;
+
 /*
  * move_tasks tries to move up to load_move weighted load from busiest to
  * this_rq, as part of a balancing operation within domain "sd".
@@ -3242,7 +3244,7 @@ static int move_tasks(struct lb_env *env)
 
 		/* take a breather every nr_migrate tasks */
 		if (env->loop > env->loop_break) {
-			env->loop_break += sysctl_sched_nr_migrate;
+			env->loop_break += sched_nr_migrate_break;
 			env->flags |= LBF_NEED_BREAK;
 			break;
 		}
@@ -4407,7 +4409,8 @@ static int load_balance(int this_cpu, struct rq *this_rq,
 		.dst_cpu	= this_cpu,
 		.dst_rq		= this_rq,
 		.idle		= idle,
-		.loop_break	= sysctl_sched_nr_migrate,
+		.loop_break	= sched_nr_migrate_break,
+		.loop_max	= sysctl_sched_nr_migrate,
 	};
 
 	cpumask_copy(cpus, cpu_active_mask);
@@ -4448,7 +4451,6 @@ static int load_balance(int this_cpu, struct rq *this_rq,
 		env.load_move = imbalance;
 		env.src_cpu = busiest->cpu;
 		env.src_rq = busiest;
-		env.loop_max = busiest->nr_running;
 
 more_balance:
 		local_irq_save(flags);



  reply	other threads:[~2012-04-17 11:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-11  1:06 Tim Chen
2012-04-17 11:43 ` Peter Zijlstra [this message]
2012-04-17 12:09 ` Peter Zijlstra
2012-04-17 16:44   ` Tim Chen
2012-04-20 14:00     ` Peter Zijlstra
2012-04-20 16:40       ` Tim Chen
2012-04-20 16:53         ` Peter Zijlstra
2012-04-20 17:13           ` Tim Chen
2012-04-20 17:33             ` Peter Zijlstra
2012-04-25 14:56               ` Peter Zijlstra
2012-04-25 17:38                 ` Tim Chen
2012-04-25 17:43                   ` Peter Zijlstra
2012-04-25 17:58                     ` Tim Chen
2012-04-26 11:56                 ` [tip:sched/urgent] sched: Fix more load-balancing fallout 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=1334663013.28150.83.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=Huang@programming.kicks-ass.net \
    --cc=alex.shi@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suresh.b.siddha@intel.com \
    --cc=tim.c.chen@linux.intel.com \
    --cc=ying.huang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome