LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Ken Chen <kenchen@google.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Mike Galbraith <efault@gmx.de>
Subject: Re: [patch] restore sched_exec load balance heuristics
Date: Thu, 6 Nov 2008 21:38:53 +0100 [thread overview]
Message-ID: <20081106203853.GF3578@elte.hu> (raw)
In-Reply-To: <b040c32a0811061232j49a40ce8md32ff5e614441e38@mail.gmail.com>
* Ken Chen <kenchen@google.com> wrote:
> On Thu, Nov 6, 2008 at 12:07 PM, Ingo Molnar <mingo@elte.hu> 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
case.
Ok?
Ingo
next prev parent 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:
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=20081106203853.GF3578@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=efault@gmx.de \
--cc=kenchen@google.com \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).