From: Peter Zijlstra <peterz@infradead.org>
To: Ingo Molnar <mingo@kernel.org>, Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: linux-kernel@vger.kernel.org, Mike Galbraith <efault@gmx.de>,
Paul Turner <pjt@google.com>, Alex Shi <alex.shi@intel.com>,
Preeti U Murthy <preeti@linux.vnet.ibm.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Morten Rasmussen <morten.rasmussen@arm.com>,
Namhyung Kim <namhyung@kernel.org>,
Joonsoo Kim <js1304@gmail.com>, Rik van Riel <riel@surriel.com>
Subject: Re: [PATCH 6/6] sched, fair: Rework and comment the group_imb code
Date: Fri, 16 Aug 2013 12:34:38 +0200 [thread overview]
Message-ID: <20130816103438.GX3008@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20130816101545.356818143@infradead.org>
On Fri, Aug 16, 2013 at 12:12:27PM +0200, Peter Zijlstra wrote:
> +/*
> + * Group imbalance indicates (and tries to solve) the problem where balancing
> + * groups is inadequate due to tsk_cpus_allowed() constraints.
> + *
> + * Imagine a situation of two groups of 4 cpus each and 4 tasks each with a
> + * cpumask covering 1 cpu of the first group and 3 cpus of the second group.
> + * Something like:
> + *
> + * { 0 1 2 3 } { 4 5 6 7 }
> + * * * * *
And yes, people think this is a reasonable thing to do :/
> + *
> + * If we were to balance group-wise we'd place two tasks in the first group and
> + * two tasks in the second group. Clearly this is undesired as it will overload
> + * cpu 3 and leave one of the cpus in the second group unused.
> + *
> + * The current solution to this issue is detecting the skew in the first group
> + * by noticing it has a cpu that is overloaded while the remaining cpus are
> + * idle -- or rather, there's a distinct imbalance in the cpus; see
> + * sg_imbalanced().
> + *
> + * When this is so detected; this group becomes a candidate for busiest; see
> + * update_sd_pick_busiest(). And calculcate_imbalance() and
> + * find_busiest_group() avoid some of the usual balance conditional to allow it
> + * to create an effective group imbalance.
> + *
> + * This is a somewhat tricky proposition since the next run might not find the
> + * group imbalance and decide the groups need to be balanced again. A most
> + * subtle and fragile situation.
> + */
One of the things that I know about which can (and does) go wrong with
this is that we typically pull 'all' tasks to the balance cpu only to
then let future (lower) load-balance passes spread that out again.
But until its spread out, we have this spike in the task distribution
that will trigger the group_imb condition.
prev parent reply other threads:[~2013-08-16 10:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-16 10:12 [PATCH 0/6] Various load-balance cleanups/optimizations Peter Zijlstra
2013-08-16 10:12 ` [PATCH 1/6] sched: Remove one division operation in find_busiest_queue() Peter Zijlstra
2013-08-16 10:12 ` [PATCH 2/6] sched: Factor out code to should_we_balance() Peter Zijlstra
2013-08-16 10:12 ` [PATCH 3/6] sched: Clean-up struct sd_lb_stat Peter Zijlstra
2013-08-16 10:12 ` [PATCH 4/6] sched, fair: Remove duplicate load_per_task computations Peter Zijlstra
2013-08-16 10:12 ` [PATCH 5/6] sched, fair: Make group power more consitent Peter Zijlstra
2013-08-19 4:17 ` Preeti U Murthy
2013-08-19 10:30 ` Peter Zijlstra
2013-08-20 5:24 ` Preeti U Murthy
2013-08-16 10:12 ` [PATCH 6/6] sched, fair: Rework and comment the group_imb code Peter Zijlstra
2013-08-16 10:34 ` Peter Zijlstra [this message]
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=20130816103438.GX3008@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=alex.shi@intel.com \
--cc=efault@gmx.de \
--cc=iamjoonsoo.kim@lge.com \
--cc=js1304@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=morten.rasmussen@arm.com \
--cc=namhyung@kernel.org \
--cc=pjt@google.com \
--cc=preeti@linux.vnet.ibm.com \
--cc=riel@surriel.com \
--cc=vincent.guittot@linaro.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
Powered by JetHome