Re: [bug-report] possible s64 overflow in max_vruntime()

From: Peter Zijlstra
Date: Fri Jan 27 2023 - 08:02:31 EST


On Thu, Jan 26, 2023 at 07:31:02PM +0100, Roman Kagan wrote:

> > All that only matters for small sleeps anyway.
> >
> > Something like:
> >
> > sleep_time = U64_MAX;
> > if (se->avg.last_update_time)
> > sleep_time = cfs_rq_clock_pelt(cfs_rq) - se->avg.last_update_time;
>
> Interesting, why not rq_clock_task(rq_of(cfs_rq)) - se->exec_start, as
> others were suggesting? It appears to better match the notion of sleep
> wall-time, no?

Should also work I suppose. cfs_rq_clock takes throttling into account,
but that should hopefully also not be *that* long, so either should
work.