Re: [PATCH 3/3] sched/deadline: Use sched_dl_entity's dl_density in dl_task_fits_capacity()

From: Dietmar Eggemann
Date: Fri Jul 08 2022 - 08:34:41 EST


On 06/07/2022 12:47, Vincent Guittot wrote:
> On Wed, 29 Jun 2022 at 14:21, Dietmar Eggemann <dietmar.eggemann@xxxxxxx> wrote:

[...]

>> 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;
>> + return cap >= p->dl.dl_density >> SCHED_CAPACITY_SHIFT;
>
> There is no direct relation between BW_SHIFT and SCHED_CAPACITY_SHIFT
> and we can change one without modifying the other.
>
> Should you use (BW_SHIFT-SCHED_CAPACITY_SHIFT) instead of SCHED_CAPACITY_SHIFT ?

Yes, that's better, similar to cpu_bw_dl(). Thanks!

[...]