mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Morten Rasmussen <morten.rasmussen@arm.com>
To: Alex Shi <alex.shi@linaro.org>
Cc: "mingo@redhat.com" <mingo@redhat.com>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"vincent.guittot@linaro.org" <vincent.guittot@linaro.org>,
	"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
	"efault@gmx.de" <efault@gmx.de>,
	"wangyun@linux.vnet.ibm.com" <wangyun@linux.vnet.ibm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mgorman@suse.de" <mgorman@suse.de>
Subject: Re: [RESEND PATCH V5 0/8] remove cpu_load idx
Date: Tue, 29 Apr 2014 15:52:21 +0100	[thread overview]
Message-ID: <20140429145221.GH2639@e103034-lin> (raw)
In-Reply-To: <1397616209-27275-1-git-send-email-alex.shi@linaro.org>

On Wed, Apr 16, 2014 at 03:43:21AM +0100, Alex Shi wrote:
> In the cpu_load decay usage, we mixed the long term, short term load with
> balance bias, randomly pick a big or small value according to balance 
> destination or source.

I disagree that it is random. min()/max() in {source,target}_load()
provides a conservative bias to the load estimate that should prevent us
from trying to pull tasks from the source cpu if its current load is
just a temporary spike. Likewise, we don't try to pull tasks to the
target cpu if the load is just a temporary drop.

> This mix is wrong, the balance bias should be based
> on task moving cost between cpu groups, not on random history or instant load.

Your patch set actually changes everything to be based on the instant
load alone. rq->cfs.runnable_load_avg is updated instantaneously when
tasks are enqueued and deqeueue, so this load expression is quite volatile.

What do you mean by "task moving cost"?

> History load maybe diverage a lot from real load, that lead to incorrect bias.
> 
> like on busy_idx,
> We mix history load decay and bias together. The ridiculous thing is, when 
> all cpu load are continuous stable, long/short term load is same. then we 
> lose the bias meaning, so any minimum imbalance may cause unnecessary task
> moving. To prevent this funny thing happen, we have to reuse the 
> imbalance_pct again in find_busiest_group().  But that clearly causes over
> bias in normal time. If there are some burst load in system, it is more worse.

Isn't imbalance_pct only used once in the periodic load-balance path?

It is not clear to me what the over bias problem is. If you have a
stable situation, I would expect the long and short term load to be the
same?

> As to idle_idx:
> Though I have some cencern of usage corretion, 
> https://lkml.org/lkml/2014/3/12/247 but since we are working on cpu
> idle migration into scheduler. The problem will be reconsidered. We don't
> need to care it too much now.
> 
> In fact, the cpu_load decays can be replaced by the sched_avg decay, that 
> also decays load on time. The balance bias part can fullly use fixed bias --
> imbalance_pct, which is already used in newly idle, wake, forkexec balancing
> and numa balancing scenarios.

As I have said previously, I agree that cpu_load[] is somewhat broken in
its current form, but I don't see how removing it and replacing it with
the instantaneous cpu load solves the problems you point out.

The current cpu_load[] averages the cpu_load over time, while
rq->cfs.runnable_load_avg is the sum of the currently runnable tasks'
load_avg_contrib. The former provides a long term view of the cpu_load,
the latter does not. It can change radically in an instant. I'm
therefore a bit concerned about the stability of the load-balance
decisions. However, since most decisions are based on cpu_load[0]
anyway, we could try setting LB_BIAS to false as Peter suggests and see
what happens.

Morten

  parent reply	other threads:[~2014-04-29 14:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16  2:43 Alex Shi
2014-04-16  2:43 ` [PATCH V5 1/8] sched: shortcut to remove load_idx Alex Shi
2014-04-16  2:43 ` [PATCH V5 2/8] sched: remove rq->cpu_load[load_idx] array Alex Shi
2014-04-16  2:43 ` [PATCH V5 3/8] sched: remove source_load and target_load Alex Shi
2014-04-24 14:18   ` Peter Zijlstra
2014-04-16  2:43 ` [PATCH V5 4/8] sched: remove LB_BIAS Alex Shi
2014-04-16  2:43 ` [PATCH V5 5/8] sched: clean up cpu_load update Alex Shi
2014-04-16  2:43 ` [PATCH V5 6/8] sched: rewrite update_cpu_load_nohz Alex Shi
2014-04-16  2:43 ` [PATCH V5 7/8] sched: remove rq->cpu_load and rq->nr_load_updates Alex Shi
2014-04-16  2:43 ` [PATCH V5 8/8] sched: rename update_*_cpu_load Alex Shi
2014-04-24 16:20 ` [RESEND PATCH V5 0/8] remove cpu_load idx Peter Zijlstra
2014-04-29 15:04   ` Morten Rasmussen
2014-05-09 16:30     ` Alex Shi
2014-05-01  0:41   ` Alex Shi
2014-05-06  9:54     ` Preeti Murthy
2014-05-06 11:39       ` Peter Zijlstra
2014-05-08  9:10         ` Preeti U Murthy
2014-04-29 14:52 ` Morten Rasmussen [this message]
2014-04-30  9:24   ` Alex Shi
2014-05-06  8:33     ` Alex Shi
2014-05-06 11:43       ` Peter Zijlstra
2014-05-09 16:41         ` Alex Shi

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=20140429145221.GH2639@e103034-lin \
    --to=morten.rasmussen@arm.com \
    --cc=alex.shi@linaro.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=vincent.guittot@linaro.org \
    --cc=wangyun@linux.vnet.ibm.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

all inboxes | Powered by JetHome®