mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valentin Schneider <valentin.schneider@arm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Morten Rasmussen <Morten.Rasmussen@arm.com>
Subject: Re: [PATCH v2 3/3] sched/fair: fix unnecessary increase of balance interval
Date: Tue, 18 Dec 2018 11:46:11 +0000	[thread overview]
Message-ID: <07400c1b-d9d7-7619-57fb-b09276d7da92@arm.com> (raw)
In-Reply-To: <CAKfTPtCJBGtmx7pQJCwhcMaxyXWoh04o_C+pR6z+YVykXwvv5Q@mail.gmail.com>

On 18/12/2018 09:32, Vincent Guittot wrote:
[...]
> In this asym packing case, It has nothing to do with pinned tasks and
> that's the root cause of the problem:
> the active balance triggered by asym packing is wrongly assumed to be
> an active balance due to pinned task(s) and the load balance interval
> is increased without any reason
> 
[...]> hmm the increase of balance interval is not linked to cpu stopper but
> to increase the load balance interval when we know that there is no
> possible load balance to perform
> 
> Regards,
> Vincent

Ah, I think I get it: you're saying that this balance_interval increase
is done because it is always assumed we do an active balance with
busiest->nr_running > 1 && pinned tasks, and that all that is left to
migrate after the active_balance is pinned tasks that we can't actually
migrate.

Maybe that's what we should target (as always, totally untested):

-----8<-----
@@ -9131,18 +9144,16 @@ static int load_balance(int this_cpu, struct rq *this_rq,
        } else
                sd->nr_balance_failed = 0;
 
-       if (likely(!active_balance)) {
-               /* We were unbalanced, so reset the balancing interval */
-               sd->balance_interval = sd->min_interval;
-       } else {
+       if (unlikely(active_balance && (env.flags & LBF_ALL_PINNED))) {
                /*
-                * If we've begun active balancing, start to back off. This
-                * case may not be covered by the all_pinned logic if there
-                * is only 1 task on the busy runqueue (because we don't call
-                * detach_tasks).
+                * We did an active balance as a last resort (all other tasks
+                * were pinned), start to back off.
                 */
                if (sd->balance_interval < sd->max_interval)
                        sd->balance_interval *= 2;
+       } else {
+               /* We were unbalanced, so reset the balancing interval */
+               sd->balance_interval = sd->min_interval;
        }
 
        goto out;
----->8-----

can_migrate_task() called by detach_tasks() in the
'if (busiest->nr_running > 1)' block should clear that LBF_ALL_PINNED flag
if there is any migratable task (even if we don't end up migrating it),
and it's not set if (busiest->nr_running == 1), so that *should* work.

I believe the argument that this applies to all kinds of active balances
is still valid - this shouldn't be changed just for asym packing active
balance.

  reply	other threads:[~2018-12-18 11:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 16:01 [PATCH v2 0/3] sched/fair: some fixes for asym_packing Vincent Guittot
2018-12-14 16:01 ` [PATCH v2 1/3] sched/fair: fix rounding issue for asym packing Vincent Guittot
2018-12-18 17:32   ` Valentin Schneider
2018-12-19  8:32     ` Vincent Guittot
2018-12-19 11:58       ` Valentin Schneider
2018-12-19 13:39         ` Vincent Guittot
2018-12-19 14:59           ` Valentin Schneider
2018-12-19 15:05             ` Vincent Guittot
2018-12-19 15:11               ` Valentin Schneider
2018-12-19 15:20                 ` Vincent Guittot
2018-12-19 15:30                   ` Valentin Schneider
2018-12-19 15:54                     ` Vincent Guittot
2018-12-14 16:01 ` [PATCH v2 2/3] sched/fair: trigger asym_packing during idle load balance Vincent Guittot
2018-12-17 16:59   ` Valentin Schneider
2018-12-18  8:17     ` Vincent Guittot
2018-12-18 12:00       ` Valentin Schneider
2018-12-14 16:01 ` [PATCH v2 3/3] sched/fair: fix unnecessary increase of balance interval Vincent Guittot
2018-12-17 16:56   ` Valentin Schneider
2018-12-18  9:32     ` Vincent Guittot
2018-12-18 11:46       ` Valentin Schneider [this message]
2018-12-18 13:23         ` Vincent Guittot
2018-12-18 14:09           ` Valentin Schneider
2018-12-19  8:27             ` Vincent Guittot
2018-12-19 11:16               ` Valentin Schneider
2018-12-19 13:29                 ` Vincent Guittot
2018-12-19 15:54                   ` Valentin Schneider
2018-12-19 16:54                     ` Vincent Guittot

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=07400c1b-d9d7-7619-57fb-b09276d7da92@arm.com \
    --to=valentin.schneider@arm.com \
    --cc=Morten.Rasmussen@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --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

all inboxes | Powered by JetHome®