Re: [RFC PATCH 1/9] sched,cgroup: Add interface for latency-nice

From: Peter Zijlstra
Date: Thu Sep 05 2019 - 07:47:23 EST


On Thu, Sep 05, 2019 at 12:30:52PM +0100, Patrick Bellasi wrote:

> I see this concept possibly evolving into something more then just a
> binary switch. Not yet convinced if it make sense and/or it's possible
> but, in principle, I was thinking about these possible usages for CFS
> tasks:
>
> - dynamically tune the policy of a task among SCHED_{OTHER,BATCH,IDLE}
> depending on crossing certain pre-configured threshold of latency
> niceness.

A big part of BATCH is wakeup preemption (batch doesn't preempt itself),
and wakeup preemption is a task-task propery and can thus be completely
relative.

> - dynamically bias the vruntime updates we do in place_entity()
> depending on the actual latency niceness of a task.

That is dangerous; theory says we should keep track of the 0-lag point
and place it back where we found it. BFQ does this correctly IIRC, but
for CFS I've never done that because 'expensive'.

But yes, we could (carefully) fumble a bit there.

> - bias the decisions we take in check_preempt_tick() still depending
> on a relative comparison of the current and wakeup task latency
> niceness values.

Ack.

Placing relative and absolute behaviour on the same scale is going to be
'fun' :-)