Re: [PATCH 4/4] sched/deadline: Implement fallback mechanism for !fit case

From: Qais Yousef
Date: Thu Apr 09 2020 - 10:55:44 EST


Hi Luca

On 04/09/20 15:00, luca abeni wrote:
> > Outside of the scope of this series. But does it make sense to make
> > sched_setattr() fail to create a new deadline task if the system will
> > be overcommitted, hence causing some dl tasks to miss their deadlines?
>
> The problem is that with multiple processors/cores it is not easy to
> know in advance if any task will miss a deadline (see section 3.3 of
> Documentation/scheduler/sched-deadline.rst).
>
> The admission control we are currently using should prevent
> SCHED_DEADLINE tasks from overloading the system (starving non-deadline
> tasks); proving hard deadline guarantees with global EDF scheduling is
> much more difficult (and could be probably done in user-space, I think).

I see. I'll dig through the docs, thanks for the reference.

> > If some overcommitting is fine (some deadlines are soft and are okay
> > to fail every once in a while), does it make sense for this to be a
> > tunable of how much the system can be overcommitted before
> > disallowing new DL tasks to be created?
>
> There is already a tunable for the SCHED_DEADLINE admission test
> (/proc/sys/kernel/sched_rt_{runtime,period}_us, if I understand well
> what you are suggesting). The problem is that it is not easy to find a
> value for this tunable that guarantees the hard respect of all
> deadlines.

I don't think it's similar to what I was referring to. But my knowledge about
DL could have failed me to fully appreciate what you're saying.

This tunable for RT prevents a single task from using 100% CPU time. I think
DL uses it in a similar manner.

What I meant by overcommiting, is allowing more DL tasks than the system can
guarantee to meet their deadlines.

For example, in the context of capacity awareness, if you have 2 big cores, but
4 DL tasks request a bandwidth that can only be satisfied by the big cores,
then 2 of them will miss their deadlines (almost) consistently, IIUC.

This can be generalized on SMP (I believe). But judging from your earlier
response, it's not as straightforward as it seems :)

>
> But IMHO if someone really wants hard deadline guarantees it is better
> to use partitioned scheduling (see Section 5 of the SCHED_DEADLINE
> documentation).

RT is the same. So this makes sense. Though one would hope to be able to
improve on this in the future. Something for me to ponder over :)

Thanks

--
Qais Yousef