All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Austin Christ <austinwc@codeaurora.org>,
	Tyler Baicar <tbaicar@codeaurora.org>,
	Timur Tabi <timur@codeaurora.org>
Subject: Re: [PATCH V5 1/2] sched/fair: Fix load_balance() affinity redo path
Date: Wed, 5 Jul 2017 13:22:32 +0200	[thread overview]
Message-ID: <20170705112232.tkeqnwh2urlc6nbx@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <1496863138-11322-2-git-send-email-jhugo@codeaurora.org>

On Wed, Jun 07, 2017 at 01:18:57PM -0600, Jeffrey Hugo wrote:
> If load_balance() fails to migrate any tasks because all tasks were
> affined, load_balance() removes the source cpu from consideration and
> attempts to redo and balance among the new subset of cpus.
> 
> There is a bug in this code path where the algorithm considers all active
> cpus in the system (minus the source that was just masked out).  This is
> not valid for two reasons: some active cpus may not be in the current
> scheduling domain and one of the active cpus is dst_cpu. These cpus should
> not be considered, as we cannot pull load from them.
> 
> Instead of failing out of load_balance(), we may end up redoing the search
> with no valid cpus and incorrectly concluding the domain is balanced.
> Additionally, if the group_imbalance flag was just set, it may also be
> incorrectly unset, thus the flag will not be seen by other cpus in future
> load_balance() runs as that algorithm intends.
> 
> Fix the check by removing cpus not in the current domain and the dst_cpu
> from considertation, thus limiting the evaluation to valid remaining cpus
> from which load might be migrated.
> 
> Co-authored-by: Austin Christ <austinwc@codeaurora.org>
> Co-authored-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
> Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
> Tested-by: Tyler Baicar <tbaicar@codeaurora.org>

Yes, this looks good. Thanks!

  reply	other threads:[~2017-07-05 11:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07 19:18 [PATCH V5 0/2] load_balance() fixes for affinity Jeffrey Hugo
2017-06-07 19:18 ` [PATCH V5 1/2] sched/fair: Fix load_balance() affinity redo path Jeffrey Hugo
2017-07-05 11:22   ` Peter Zijlstra [this message]
2017-07-05 22:48   ` [tip:sched/urgent] " tip-bot for Jeffrey Hugo
2017-06-07 19:18 ` [PATCH V5 2/2] sched/fair: Remove group imbalance from calculate_imbalance() Jeffrey Hugo
2017-07-05 11:22   ` Peter Zijlstra
2017-07-07 15:26     ` Jeffrey Hugo
2017-06-13 14:32 ` [PATCH V5 0/2] load_balance() fixes for affinity Jeffrey Hugo
2017-06-20 14:28   ` Jeffrey Hugo
2017-06-28 16:12     ` Jeffrey Hugo
2017-07-05  9:19       ` 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=20170705112232.tkeqnwh2urlc6nbx@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=austinwc@codeaurora.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=jhugo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tbaicar@codeaurora.org \
    --cc=timur@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.