From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Pavan Kondeti <pkondeti@codeaurora.org>
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Steven Rostedt <rostedt@goodmis.org>,
Luca Abeni <luca.abeni@santannapisa.it>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
Wei Wang <wvw@google.com>, Quentin Perret <qperret@google.com>,
Alessio Balsini <balsini@google.com>,
Patrick Bellasi <patrick.bellasi@matbug.net>,
Morten Rasmussen <morten.rasmussen@arm.com>,
Valentin Schneider <valentin.schneider@arm.com>,
Qais Yousef <qais.yousef@arm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/6] sched/deadline: Make DL capacity-aware
Date: Fri, 1 May 2020 18:12:07 +0200 [thread overview]
Message-ID: <aa00aee6-2adb-569b-825b-781da12ad8d3@arm.com> (raw)
In-Reply-To: <20200430131036.GE19464@codeaurora.org>
On 30/04/2020 15:10, Pavan Kondeti wrote:
> On Mon, Apr 27, 2020 at 10:37:08AM +0200, Dietmar Eggemann wrote:
>> From: Luca Abeni <luca.abeni@santannapisa.it>
[...]
>> @@ -1653,10 +1654,19 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
>> * other hand, if it has a shorter deadline, we
>> * try to make it stay here, it might be important.
>> */
>> - if (unlikely(dl_task(curr)) &&
>> - (curr->nr_cpus_allowed < 2 ||
>> - !dl_entity_preempt(&p->dl, &curr->dl)) &&
>> - (p->nr_cpus_allowed > 1)) {
>> + select_rq = unlikely(dl_task(curr)) &&
>> + (curr->nr_cpus_allowed < 2 ||
>> + !dl_entity_preempt(&p->dl, &curr->dl)) &&
>> + p->nr_cpus_allowed > 1;
>> +
>> + /*
>> + * Take the capacity of the CPU into account to
>> + * ensure it fits the requirement of the task.
>> + */
>> + if (static_branch_unlikely(&sched_asym_cpucapacity))
>> + select_rq |= !dl_task_fits_capacity(p, cpu);
>> +
>> + if (select_rq) {
>> int target = find_later_rq(p);
>
> I see that find_later_rq() checks if the previous CPU is part of
> later_mask and returns it immediately. So we don't migrate the
> task in the case where there previous CPU can't fit the task and
> there are no idle CPUs on which the task can fit. LGTM.
Hope I understand you here. I don't think that [patch 6/6] provides this
already.
In case 'later_mask' has no fitting CPUs, 'max_cpu' is set in the
otherwise empty 'later_mask'. But 'max_cpu' is not necessary task_cpu(p).
Example on Juno [L b b L L L] with thread0-0 (big task)
cpudl_find [thread0-0 2117] orig later_mask=0,3-4 later_mask=0
find_later_rq [thread0-0 2117] task_cpu=2 later_mask=0
A tweak could be added favor task_cpu(p) in case it is amongst the CPUs
with the maximum capacity in cpudl_find() for the !fit case.
[...]
>> +/*
>> + * Verify the fitness of task @p to run on @cpu taking into account the
>> + * CPU original capacity and the runtime/deadline ratio of the task.
>> + *
>> + * The function will return true if the CPU original capacity of the
>> + * @cpu scaled by SCHED_CAPACITY_SCALE >= runtime/deadline ratio of the
>> + * task and false otherwise.
>> + */
>> +static inline bool dl_task_fits_capacity(struct task_struct *p, int cpu)
>> +{
>> + unsigned long cap = arch_scale_cpu_capacity(cpu);
>> +
>> + return cap_scale(p->dl.dl_deadline, cap) >= p->dl.dl_runtime;
>> +}
>> +
>
> This is same as
>
> return p->dl.dl_bw >> (BW_SHIFT - SCHED_CAPACITY_SHIFT) <= cap
>
> Correct? If yes, would it be better to use this?
We could use sched_dl_entity::dl_density (dl_runtime / dl_deadline) but
then I would have to export BW_SHIFT.
next prev parent reply other threads:[~2020-05-01 16:12 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-27 8:37 [PATCH v2 0/6] Capacity awareness for SCHED_DEADLINE Dietmar Eggemann
2020-04-27 8:37 ` [PATCH v2 1/6] sched/topology: Store root domain CPU capacity sum Dietmar Eggemann
2020-04-27 8:37 ` [PATCH v2 2/6] sched/deadline: Optimize dl_bw_cpus() Dietmar Eggemann
2020-04-30 10:55 ` Pavan Kondeti
2020-05-01 16:12 ` Dietmar Eggemann
2020-04-27 8:37 ` [PATCH v2 3/6] sched/deadline: Add dl_bw_capacity() Dietmar Eggemann
2020-05-06 10:54 ` Dietmar Eggemann
2020-05-06 12:37 ` Juri Lelli
2020-05-06 15:09 ` Dietmar Eggemann
2020-05-11 8:01 ` Juri Lelli
2020-05-12 12:39 ` Dietmar Eggemann
2020-05-15 12:26 ` Juri Lelli
2020-04-27 8:37 ` [PATCH v2 4/6] sched/deadline: Improve admission control for asymmetric CPU capacities Dietmar Eggemann
2020-04-27 8:37 ` [PATCH v2 5/6] sched/deadline: Make DL capacity-aware Dietmar Eggemann
2020-04-30 13:10 ` Pavan Kondeti
2020-05-01 16:12 ` Dietmar Eggemann [this message]
2020-05-04 3:58 ` Pavan Kondeti
2020-05-05 18:02 ` Dietmar Eggemann
2020-04-27 8:37 ` [PATCH v2 6/6] sched/deadline: Implement fallback mechanism for !fit case Dietmar Eggemann
2020-04-27 13:34 ` Juri Lelli
2020-04-27 14:17 ` luca abeni
2020-04-29 17:39 ` Dietmar Eggemann
2020-04-30 11:00 ` Pavan Kondeti
2020-05-01 16:12 ` Dietmar Eggemann
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=aa00aee6-2adb-569b-825b-781da12ad8d3@arm.com \
--to=dietmar.eggemann@arm.com \
--cc=balsini@google.com \
--cc=bristot@redhat.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.abeni@santannapisa.it \
--cc=mingo@redhat.com \
--cc=morten.rasmussen@arm.com \
--cc=patrick.bellasi@matbug.net \
--cc=peterz@infradead.org \
--cc=pkondeti@codeaurora.org \
--cc=qais.yousef@arm.com \
--cc=qperret@google.com \
--cc=rostedt@goodmis.org \
--cc=valentin.schneider@arm.com \
--cc=vincent.guittot@linaro.org \
--cc=wvw@google.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;
as well as URLs for NNTP newsgroup(s).