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

From: Quentin Perret
Date: Tue May 07 2019 - 09:36:24 EST


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 ?

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

> + 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