From: Valentin Schneider <valentin.schneider@arm.com>
To: Dietmar Eggemann <dietmar.eggemann@arm.com>,
Pavan Kondeti <pkondeti@codeaurora.org>
Cc: linux-kernel@vger.kernel.org, mingo@redhat.com,
peterz@infradead.org, vincent.guittot@linaro.org,
morten.rasmussen@arm.com, qperret@google.com,
adharmap@codeaurora.org
Subject: Re: [PATCH v3 1/3] sched/fair: Add asymmetric CPU capacity wakeup scan
Date: Wed, 29 Jan 2020 12:10:05 +0000 [thread overview]
Message-ID: <f5eb1fa8-2b0e-19ed-fa74-a16bfa50dc17@arm.com> (raw)
In-Reply-To: <1aa14491-517e-92d2-08b0-568338d75812@arm.com>
On 29/01/2020 10:38, Dietmar Eggemann wrote:
> On 28/01/2020 12:30, Valentin Schneider wrote:
>> Hi Pavan,
>>
>> On 28/01/2020 06:22, Pavan Kondeti wrote:
>>> Hi Valentin,
>>>
>>> On Sun, Jan 26, 2020 at 08:09:32PM +0000, Valentin Schneider wrote:
>
> [...]
>
>>>> +
>>>> + if (!static_branch_unlikely(&sched_asym_cpucapacity))
>>>> + return -1;
>
> We do need this one to bail out quickly on non CPU asym systems. (1)
>
>>>> + sd = rcu_dereference(per_cpu(sd_asym_cpucapacity, target));
>>>> + if (!sd)
>>>> + return -1;
>
> And I assume we can't return target here because of exclusive cpusets
> which can form symmetric CPU capacities islands on a CPU asymmetric
> system? (2)
>
Precisely, the "canonical" check for asymmetry is static key + SD pointer.
In terms of functionality we could "just" check sd_asym_cpucapacity (it can't
be set without having the static key set, though the reverse isn't true),
but we *want* to use the static key here to make SMP people happy.
>> That's not the case anymore, so indeed we may be able to bail out of
>> select_idle_sibling() right after select_idle_capacity() (or after the
>> prev / recent_used_cpu checks). Our only requirement here is that sd_llc
>> remains a subset of sd_asym_cpucapacity.
>
> How do you distinguish '-1' in (1), (2) and 'best_cpu = -1' (3)?
>
> In (1) and (2) you want to check if target is idle (or sched_idle) but
> in (3) you probably only want to check 'recent_used_cpu'?
>
Right, when we come back from select_idle_capacity(), and we did go through
the CPU loop, but we still returned -1, it means all CPUs in sd_asym_cpucapacity
were not idle. This includes 'target' of course, so we shouldn't need to
check it again.
In those cases we might still not have evaluated 'prev' or 'recent_used_cpu'.
It's somewhat of a last ditch attempt to find an idle CPU, and they'll only
help when they aren't in sd_asym_cpucapacity. I'm actually curious as to how
much the 'recent_used_cpu' thing helps, I've never paid it much attention.
So yeah my options are (for asym CPU capacity topologies):
a) just bail out after select_idle_capacity()
b) try to squeeze out a bit more out of select_idle_sibling() by also doing
the 'prev' & 'recent_used_cpu' checks.
a) is quite easy to implement; I can just inline the static key and sd checks
in select_idle_sibling() and return unconditionally once I'm past those
checks.
b) is more intrusive and I don't have a clear picture yet as to how much it
will really bring to the table.
I'll think about it and try to play around with both of these.
next prev parent reply other threads:[~2020-01-29 12:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-26 20:09 [PATCH v3 0/3] sched/fair: Capacity aware wakeup rework Valentin Schneider
2020-01-26 20:09 ` [PATCH v3 1/3] sched/fair: Add asymmetric CPU capacity wakeup scan Valentin Schneider
2020-01-28 6:22 ` Pavan Kondeti
2020-01-28 11:30 ` Valentin Schneider
2020-01-29 3:52 ` Pavan Kondeti
2020-01-29 8:16 ` Qais Yousef
2020-01-29 9:25 ` Valentin Schneider
2020-01-29 10:38 ` Dietmar Eggemann
2020-01-29 12:10 ` Valentin Schneider [this message]
2020-01-29 11:04 ` Dietmar Eggemann
2020-01-29 12:10 ` Valentin Schneider
2020-01-26 20:09 ` [PATCH v3 2/3] sched/topology: Remove SD_BALANCE_WAKE on asymmetric capacity systems Valentin Schneider
2020-01-29 16:27 ` Dietmar Eggemann
2020-01-30 11:06 ` Valentin Schneider
2020-01-26 20:09 ` [PATCH v3 3/3] sched/fair: Kill wake_cap() Valentin Schneider
2020-01-28 9:24 ` [PATCH v3 0/3] sched/fair: Capacity aware wakeup rework Dietmar Eggemann
2020-01-28 11:34 ` 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=f5eb1fa8-2b0e-19ed-fa74-a16bfa50dc17@arm.com \
--to=valentin.schneider@arm.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=qperret@google.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
Powered by JetHome