Re: [PATCH v6 2/3] sched/fair: Add cfs bandwidth burst statistics

From: Peter Zijlstra
Date: Mon Jun 28 2021 - 11:47:07 EST


On Mon, Jun 28, 2021 at 05:00:30PM +0200, Peter Zijlstra wrote:
> I was hoping we could get away with something simpler, like maybe:
>
> u64 old_runtim = cfs_b->runtime;
>
> cfs_b->runtime += cfs_b->quota
> cfs_b->runtime = min(cfs_b->runtime, cfs_b->quota + cfs_b->burst);
>
> if (cfs_b->runtime - old_runtime > cfs_b->quota)
> cfs_b->nr_bursts++;
>
> Would that be good enough?

Bah,, of course not ... :-/ At best we can detect == quota, which might
be a good enough indicator of burst.