From: Peter Zijlstra <peterz@infradead.org>
To: Vladimir Davydov <vdavydov@parallels.com>
Cc: Ingo Molnar <mingo@kernel.org>, Paul Turner <pjt@google.com>,
linux-kernel@vger.kernel.org, devel@openvz.org
Subject: Re: [PATCH 2/2] sched: load_balance: Reset env when going to redo due to all pinned
Date: Mon, 16 Sep 2013 07:43:01 +0200 [thread overview]
Message-ID: <20130916054301.GK21832@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <c34e2ebbe55403d5db111fa3ecdf6ca52b73a337.1379265590.git.vdavydov@parallels.com>
On Sun, Sep 15, 2013 at 09:30:14PM +0400, Vladimir Davydov wrote:
> Firstly, reset env.dst_cpu/dst_rq to this_cpu/this_rq, because it could
> have changed in 'some pinned' case. Otherwise, should_we_balance() can
> stop balancing beforehand.
>
> Secondly, reset env.flags, because it can have LBF_SOME_PINNED set.
>
> Thirdly, reset env.dst_grpmask cpus in env.cpus to allow handling 'some
> pinned' case when pulling tasks from a new busiest cpu.
Did you actually run into any problems because of this?
> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
> ---
> kernel/sched/fair.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index cd59640..d840e51 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -5289,8 +5289,16 @@ more_balance:
> if (unlikely(env.flags & LBF_ALL_PINNED)) {
> cpumask_clear_cpu(cpu_of(busiest), cpus);
> if (!cpumask_empty(cpus)) {
> - env.loop = 0;
> - env.loop_break = sched_nr_migrate_break;
> + env.dst_cpu = this_cpu;
> + env.dst_rq = this_rq;
> + env.flags = 0;
> + env.loop = 0;
> + env.loop_break = sched_nr_migrate_break;
> +
> + /* Reset cpus cleared in LBF_SOME_PINNED case */
> + if (env.dst_grpmask)
> + cpumask_or(cpus, cpus, env.dst_grpmask);
> +
> goto redo;
> }
> goto out_balanced;
So the problem I have with this is that it removes the bound on the
number of iterations we do. Currently we're limited by the bits in cpus,
but by resetting those we can do on and on and on...
next prev parent reply other threads:[~2013-09-16 5:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-15 17:30 [PATCH 1/2] sched: load_balance: Prevent reselect prev dst_cpu if some pinned Vladimir Davydov
2013-09-15 17:30 ` [PATCH 2/2] sched: load_balance: Reset env when going to redo due to all pinned Vladimir Davydov
2013-09-16 5:43 ` Peter Zijlstra [this message]
2013-09-16 8:08 ` Vladimir Davydov
2013-09-16 8:16 ` Peter Zijlstra
2013-09-16 8:08 ` [PATCH 1/2] sched: load_balance: Prevent reselect prev dst_cpu if some pinned Peter Zijlstra
2013-09-20 13:47 ` [tip:sched/core] sched/balancing: Prevent the reselection of a previous env.dst_cpu if some tasks are pinned tip-bot for Vladimir Davydov
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=20130916054301.GK21832@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=devel@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=pjt@google.com \
--cc=vdavydov@parallels.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