LKML Archive on
help / color / mirror / Atom feed
From: Ingo Molnar <>
To: Ken Chen <>
Cc: Linux Kernel Mailing List <>,
	Peter Zijlstra <>,
	Mike Galbraith <>
Subject: Re: [patch] restore sched_exec load balance heuristics
Date: Thu, 6 Nov 2008 21:38:53 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

* Ken Chen <> wrote:

> On Thu, Nov 6, 2008 at 12:07 PM, Ingo Molnar <> wrote:
> > ok, this should be solved - but rather at the level of
> > sched_balance_self(): it should never migrate this task over to
> > another cpu, it should take away this task's load from the current
> > CPU's load when considering migration.
> There are two callers to sched_balance_self().  In the sched_fork 
> path, sched_balance_self will balance the newly forked task.  I 
> think it is OK to bounce a newly forked task to another CPU since 
> current CPU will be busy when fork returns in the parent process.
> And if sched_balance_self() needs to different between fork / exec 
> load balance, it has to check a flag from function argument, which I 
> think it is better to just short circuit in sched_exec() directly.

yes, but the problem is deeper than that and your fix only addresses 
teh most obvious case: when a single task is exec()-ing. But if we 
exec while there are two tasks on this CPU, and one task on every 
other CPU, we bounce around the "new" task unnecessarily just as much.

So the best solution is to pass in not a flag, but a 'load bias' 
offset - which is 0 in the fork case and -self-weight in the exec 



  reply	other threads:[~2008-11-06 20:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-06 19:40 [patch] restore sched_exec load balance heuristics Ken Chen
2008-11-06 20:07 ` Ingo Molnar
2008-11-06 20:32   ` Ken Chen
2008-11-06 20:38     ` Ingo Molnar [this message]
2008-11-06 20:49     ` Chris Friesen
2008-11-10  8:50   ` Peter Zijlstra
2008-11-10  9:29     ` Ingo Molnar
2008-11-10 12:54       ` 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).