Re: [RFC PATCH 2/6] sched/dl: Capacity-aware migrations

From: luca abeni
Date: Tue May 07 2019 - 10:18:41 EST


Hi Quentin,

On Tue, 7 May 2019 14:35:28 +0100
Quentin Perret <quentin.perret@xxxxxxx> wrote:

> Hi Luca,
>
> On Monday 06 May 2019 at 06:48:32 (+0200), Luca Abeni wrote:
> > +static inline int dl_task_fit(const struct sched_dl_entity *dl_se,
> > + int cpu, u64 *c)
> > +{
> > + u64 cap = (arch_scale_cpu_capacity(NULL, cpu) *
> > arch_scale_freq_capacity(cpu)) >> SCHED_CAPACITY_SHIFT;
>
> I'm a little bit confused by this use of arch_scale_freq_capacity()
> here. IIUC this means you would say a big DL task doesn't fit on a big
> CPU just because it happens to be running at a low frequency when this
> function is called. Is this what we want ?

The idea of this approach was to avoid frequency switches when
possible; so, I wanted to check if the task fits on a CPU core at its
current operating frequency.


> If the frequency is low, we can (probably) raise it to accommodate
> this DL task so perhaps we should say it fits ?

In a later patch, if the task does not fit on any core (at its current
frequency), the task is moved to the core having the maximum capacity
(without considering the operating frequency --- at least, this was my
intention when I wrote the patches :)



Luca

>
> > + s64 rel_deadline = dl_se->dl_deadline;
> > + u64 rem_runtime = dl_se->dl_runtime;
> > +
> > + if (c)
> > + *c = cap;
> > +
> > + if ((rel_deadline * cap) >> SCHED_CAPACITY_SHIFT <
> > rem_runtime)
> > + return 0;
> > +
> > + return 1;
> > +}
>
> Thanks,
> Quentin