Re: [PATCH 11/15] sched/eevdf: Better handle mixed slice length

From: Peter Zijlstra
Date: Sat Jun 10 2023 - 07:23:53 EST


On Sat, Jun 10, 2023 at 02:34:04PM +0800, Chen Yu wrote:

> > +static inline bool
> > +entity_has_slept(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
> > +{
> > + u64 now;
> > +
> > + if (!(flags & ENQUEUE_WAKEUP))
> > + return false;
> > +
> > + if (flags & ENQUEUE_MIGRATED)
> > + return true;
> > +
> > + now = rq_clock_task(rq_of(cfs_rq));
> > + return (s64)(se->exec_start - now) >= se->slice;
> > +}
> A minor question, should it be now - se->exec_start ?
> (se->exec_start - now) is always negetive on local wakeup?

Yeah, also:

https://lkml.kernel.org/r/20230608124440.GB1002251@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

That is, it should be something along the lines of:

delta = new - se->exec->start
rerturn delta/W > vslice