From: Quentin Perret <qperret@google.com>
To: Valentin Schneider <valentin.schneider@arm.com>
Cc: linux-kernel@vger.kernel.org, mingo@redhat.com,
peterz@infradead.org, vincent.guittot@linaro.org,
dietmar.eggemann@arm.com, morten.rasmussen@arm.com,
adharmap@codeaurora.org, pkondeti@codeaurora.org
Subject: Re: [PATCH v4 1/4] sched/fair: Add asymmetric CPU capacity wakeup scan
Date: Fri, 7 Feb 2020 11:01:09 +0000 [thread overview]
Message-ID: <20200207110109.GB228234@google.com> (raw)
In-Reply-To: <20200206191957.12325-2-valentin.schneider@arm.com>
On Thursday 06 Feb 2020 at 19:19:54 (+0000), Valentin Schneider wrote:
> From: Morten Rasmussen <morten.rasmussen@arm.com>
>
> Issue
> =====
>
> On asymmetric CPU capacity topologies, we currently rely on wake_cap() to
> drive select_task_rq_fair() towards either
> - its slow-path (find_idlest_cpu()) if either the previous or
> current (waking) CPU has too little capacity for the waking task
> - its fast-path (select_idle_sibling()) otherwise
>
> Commit 3273163c6775 ("sched/fair: Let asymmetric CPU configurations balance
> at wake-up") points out that this relies on the assumption that "[...]the
> CPU capacities within an SD_SHARE_PKG_RESOURCES domain (sd_llc) are
> homogeneous".
>
> This assumption no longer holds on newer generations of big.LITTLE
> systems (DynamIQ), which can accommodate CPUs of different compute capacity
> within a single LLC domain. To hopefully paint a better picture, a regular
> big.LITTLE topology would look like this:
>
> +---------+ +---------+
> | L2 | | L2 |
> +----+----+ +----+----+
> |CPU0|CPU1| |CPU2|CPU3|
> +----+----+ +----+----+
> ^^^ ^^^
> LITTLEs bigs
>
> which would result in the following scheduler topology:
>
> DIE [ ] <- sd_asym_cpucapacity
> MC [ ] [ ] <- sd_llc
> 0 1 2 3
>
> Conversely, a DynamIQ topology could look like:
>
> +-------------------+
> | L3 |
> +----+----+----+----+
> | L2 | L2 | L2 | L2 |
> +----+----+----+----+
> |CPU0|CPU1|CPU2|CPU3|
> +----+----+----+----+
> ^^^^^ ^^^^^
> LITTLEs bigs
>
> which would result in the following scheduler topology:
>
> MC [ ] <- sd_llc, sd_asym_cpucapacity
> 0 1 2 3
>
> What this means is that, on DynamIQ systems, we could pass the wake_cap()
> test (IOW presume the waking task fits on the CPU capacities of some LLC
> domain), thus go through select_idle_sibling().
> This function operates on an LLC domain, which here spans both bigs and
> LITTLEs, so it could very well pick a CPU of too small capacity for the
> task, despite there being fitting idle CPUs - it very much depends on the
> CPU iteration order, on which we have absolutely no guarantees
> capacity-wise.
>
> Implementation
> ==============
>
> Introduce yet another select_idle_sibling() helper function that takes CPU
> capacity into account. The policy is to pick the first idle CPU which is
> big enough for the task (task_util * margin < cpu_capacity). If no
> idle CPU is big enough, we pick the idle one with the highest capacity.
>
> Unlike other select_idle_sibling() helpers, this one operates on the
> sd_asym_cpucapacity sched_domain pointer, which is guaranteed to span all
> known CPU capacities in the system. As such, this will work for both
> "legacy" big.LITTLE (LITTLEs & bigs split at MC, joined at DIE) and for
> newer DynamIQ systems (e.g. LITTLEs and bigs in the same MC domain).
>
> Note that this limits the scope of select_idle_sibling() to
> select_idle_capacity() for asymmetric CPU capacity systems - the LLC domain
> will not be scanned, and no further heuristic will be applied.
>
> Signed-off-by: Morten Rasmussen <morten.rasmussen@arm.com>
> Co-developed-by: Valentin Schneider <valentin.schneider@arm.com>
> Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Reviewed-by: Quentin Perret <qperret@google.com>
Thanks,
Quentin
next prev parent reply other threads:[~2020-02-07 11:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-06 19:19 [PATCH v4 0/4] sched/fair: Capacity aware wakeup rework Valentin Schneider
2020-02-06 19:19 ` [PATCH v4 1/4] sched/fair: Add asymmetric CPU capacity wakeup scan Valentin Schneider
2020-02-07 5:08 ` Pavan Kondeti
2020-02-07 10:18 ` Valentin Schneider
2020-02-07 11:01 ` Quentin Perret [this message]
2020-02-11 12:47 ` [tip: sched/core] " tip-bot2 for Morten Rasmussen
2020-02-20 20:09 ` tip-bot2 for Morten Rasmussen
2020-02-06 19:19 ` [PATCH v4 2/4] sched/topology: Remove SD_BALANCE_WAKE on asymmetric capacity systems Valentin Schneider
2020-02-07 11:03 ` Quentin Perret
2020-02-11 12:47 ` [tip: sched/core] " tip-bot2 for Morten Rasmussen
2020-02-20 20:09 ` tip-bot2 for Morten Rasmussen
2020-02-06 19:19 ` [PATCH v4 3/4] sched: Remove for_each_lower_domain() Valentin Schneider
2020-02-07 11:04 ` Quentin Perret
2020-02-11 12:47 ` [tip: sched/core] sched/core: " tip-bot2 for Valentin Schneider
2020-02-20 20:09 ` tip-bot2 for Valentin Schneider
2020-02-06 19:19 ` [PATCH v4 4/4] sched/fair: Kill wake_cap() Valentin Schneider
2020-02-07 11:19 ` Quentin Perret
2020-02-07 12:48 ` Valentin Schneider
2020-02-11 12:47 ` [tip: sched/core] sched/fair: Remove wake_cap() tip-bot2 for Morten Rasmussen
2020-02-20 20:09 ` tip-bot2 for Morten Rasmussen
2020-02-07 10:42 ` [PATCH v4 0/4] sched/fair: Capacity aware wakeup rework Quentin Perret
2020-02-07 12:41 ` Valentin Schneider
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=20200207110109.GB228234@google.com \
--to=qperret@google.com \
--cc=adharmap@codeaurora.org \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=morten.rasmussen@arm.com \
--cc=peterz@infradead.org \
--cc=pkondeti@codeaurora.org \
--cc=valentin.schneider@arm.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