From: Valentin Schneider <valentin.schneider@arm.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@redhat.com, peterz@infradead.org,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
morten.rasmussen@arm.com, qperret@google.com,
adharmap@codeaurora.org
Subject: Re: [PATCH v2 1/3] sched/fair: Add asymmetric CPU capacity wakeup scan
Date: Fri, 24 Jan 2020 14:14:47 +0000 [thread overview]
Message-ID: <00aa64e8-5e75-181e-a4f4-72c2ac64081c@arm.com> (raw)
In-Reply-To: <20200124130213.24886-2-valentin.schneider@arm.com>
(copied over from the v1 thread)
On 24/01/2020 12:59, Quentin Perret wrote:
> Hey Valentin,
>
> On Friday 24 Jan 2020 at 12:42:53 (+0000), Valentin Schneider wrote:
>> +/*
>> + * Scan the asym_capacity domain for idle CPUs; pick the first idle one on which
>> + * the task fits.
>> + */
>> +static int select_idle_capacity(struct task_struct *p, int target)
>> +{
>> + struct sched_domain *sd;
>> + struct cpumask *cpus;
>> + int cpu;
>> +
>> + if (!static_branch_unlikely(&sched_asym_cpucapacity))
>> + return -1;
>> +
>> + sd = rcu_dereference(per_cpu(sd_asym_cpucapacity, target));
>> + if (!sd)
>> + return -1;
>> +
>
> You might want 'sync_entity_load_avg(&p->se)' here no ?
> find_idlest_cpu() and wake_cap() need one, but since we're going to use
> them, you'll want to sync here too I think.
>
Yeah, I think you're right, it's the exact same scenario here.
>> + cpus = this_cpu_cpumask_var_ptr(select_idle_mask);
>> + cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr);
>> +
>> + for_each_cpu_wrap(cpu, cpus, target) {
>> + if (!available_idle_cpu(cpu))
>> + continue;
>> + if (!task_fits_capacity(p, capacity_of(cpu)))
>> + continue;
>> +
>> + return cpu;
>
> If we found an idle CPU, but not one big enough, should we still go
> ahead and choose it ? Misfit / idle balance will fix that later when a
> big CPU does become available.
>
If we fail to find a big enough CPU, we'll just fallback to the rest of
select_idle_sibling() which will pick an idle CPU, just without caring
about capacity.
Now an alternative here would be to:
- return the first idle CPU on which the task fits (what the above does)
- else, return the biggest idle CPU we found (this could e.g. still steer
the task towards a medium on a tri-capacity system)
I think what we were trying to go with here is to not entirely hijack
select_idle_sibling(). If we go with the above alternative, topologies
with sched_asym_cpucapacity enabled would only ever see
select_idle_capacity() and not the rest of select_idle_sibling(). Not sure
if it's a bad thing or not, but it's something to ponder over.
next prev parent reply other threads:[~2020-01-24 14:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-24 13:02 [PATCH v2 0/3] sched/fair: Capacity aware wakeup rework Valentin Schneider
2020-01-24 13:02 ` [PATCH v2 1/3] sched/fair: Add asymmetric CPU capacity wakeup scan Valentin Schneider
2020-01-24 14:14 ` Valentin Schneider [this message]
2020-01-24 15:11 ` Quentin Perret
2020-01-24 15:25 ` Valentin Schneider
2020-01-24 13:02 ` [PATCH v2 2/3] sched/topology: Remove SD_BALANCE_WAKE on asymmetric capacity systems Valentin Schneider
2020-01-24 13:02 ` [PATCH v2 3/3] sched/fair: Kill wake_cap() 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=00aa64e8-5e75-181e-a4f4-72c2ac64081c@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=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
all inboxes | Powered by JetHome®