mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Hongyan Xia <Hongyan.Xia2@arm.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Juri Lelli <juri.lelli@redhat.com>
Cc: Qais Yousef <qyousef@layalina.io>,
	Morten Rasmussen <morten.rasmussen@arm.com>,
	Lukasz Luba <lukasz.luba@arm.com>,
	Christian Loehle <christian.loehle@arm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 4/6] sched/fair: Rewrite util_fits_cpu()
Date: Thu, 2 Nov 2023 18:37:33 +0100	[thread overview]
Message-ID: <ad78436f-43c3-4b4b-9cb5-28dffd43468a@arm.com> (raw)
In-Reply-To: <d8371d0764b595ab496b4fb744fdcba0a82bf41d.1696345700.git.Hongyan.Xia2@arm.com>

On 04/10/2023 11:04, Hongyan Xia wrote:
> From: Hongyan Xia <hongyan.xia2@arm.com>
> 
> Currently, there's no way to distinguish the difference between 1) a CPU
> that is actually maxed out at its highest frequency, or 2) one that is
> throttled because of UCLAMP_MAX, since both present util_avg values of
> 1024. This is problematic because when we try to pick a CPU for a task
> to run, we would like to give 2) a chance, or at least prefer 2) to 1).
> 
> Current upstream gives neither a chance because the spare capacity is 0
> for either case. There are patches to fix this problem by considering 0
> capacities [1], but this might still be inefficient because this ends
> up treating 1) and 2) equally, and will always pick the same one because
> we don't change how we iterate through all CPUs. If we end up putting
> many tasks on 1), then this creates a seriously unbalanced load for the
> two CPUs.
> 
> Fix by using util_avg_uclamp for util_fits_cpu(). This way, case 1) will
> still keep its utilization at 1024 whereas 2) shows spare capacities if
> the sum of util_avg_uclamp values is still under the CPU capacity.
> Note that this is roughly what the sum aggregation does in the Android
> kernel [2] (although we clamp UCLAMP_MIN as well in this patch, which
> may need some discussions), which shows superior energy savings because
> there's more chance that a task can get scheduled on 2) instead of
> finding a big CPU to run on.
> 
> Under sum aggregation, checking whether a task fits a CPU becomes much
> simpler. We simply do fits_capacity() and there does not need to be code
> checking all corner cases for uclamp. This means util_fits_cpu() returns
> to true and false instead of tri-state, simplifying a significant amount
> of code.

You could remove util_fits_cpu() and task_fits_cpu() and call
fits_capacity() directly. We should try to keep the zoo of util-related
functions as small as possible.

[...]


  reply	other threads:[~2023-11-02 17:37 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04  9:04 [RFC PATCH 0/6] sched: uclamp sum aggregation Hongyan Xia
2023-10-04  9:04 ` [RFC PATCH 1/6] sched/uclamp: Track uclamped util_avg in sched_avg Hongyan Xia
2023-10-31 15:52   ` Dietmar Eggemann
2023-11-09 16:05     ` Hongyan Xia
2023-11-14 12:59       ` Dietmar Eggemann
2023-12-04 16:07   ` Vincent Guittot
2023-12-05 14:24     ` Hongyan Xia
2023-12-05 16:22       ` Vincent Guittot
2023-10-04  9:04 ` [RFC PATCH 2/6] sched/uclamp: Simulate PELT decay in util_avg_uclamp Hongyan Xia
2023-11-01 16:06   ` Dietmar Eggemann
2023-11-09 16:50     ` Hongyan Xia
2023-12-04 16:07   ` Vincent Guittot
2023-12-05 14:47     ` Hongyan Xia
2023-10-04  9:04 ` [RFC PATCH 3/6] sched/fair: Use CFS util_avg_uclamp for utilization and frequency Hongyan Xia
2023-11-01 22:34   ` Dietmar Eggemann
2023-10-04  9:04 ` [RFC PATCH 4/6] sched/fair: Rewrite util_fits_cpu() Hongyan Xia
2023-11-02 17:37   ` Dietmar Eggemann [this message]
2023-10-04  9:04 ` [RFC PATCH 5/6] sched/uclamp: Remove all uclamp bucket logic Hongyan Xia
2023-11-03 13:50   ` Dietmar Eggemann
2023-11-03 14:01     ` Hongyan Xia
2023-10-04  9:04 ` [RFC PATCH 6/6] sched/uclamp: Simplify uclamp_eff_value() Hongyan Xia
2023-11-03 14:50   ` Dietmar Eggemann
2023-10-30 18:46 ` [RFC PATCH 0/6] sched: uclamp sum aggregation Dietmar Eggemann
2023-11-03 11:19   ` Hongyan Xia
2023-11-13  9:26     ` Dietmar Eggemann
2023-12-03  0:25 ` Qais Yousef
2023-12-04  1:48   ` Hongyan Xia
2023-12-04 16:12     ` Vincent Guittot
2023-12-05 15:18       ` Hongyan Xia
2023-12-05 16:26         ` Vincent Guittot
2023-12-05 17:23           ` Hongyan Xia

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=ad78436f-43c3-4b4b-9cb5-28dffd43468a@arm.com \
    --to=dietmar.eggemann@arm.com \
    --cc=Hongyan.Xia2@arm.com \
    --cc=christian.loehle@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=mingo@redhat.com \
    --cc=morten.rasmussen@arm.com \
    --cc=peterz@infradead.org \
    --cc=qyousef@layalina.io \
    --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®