Re: [PATCH v2 5/7] sched/fair: Increase weight bits for avg_vruntime

From: K Prateek Nayak

Date: Fri Apr 03 2026 - 00:02:45 EST


On 4/2/2026 4:26 PM, K Prateek Nayak wrote:
>> That is, something like the below... But with a comment ofc :-)
>>
>> Does that make sense?
>
> Let me go queue an overnight test to see if I trip that warning or
> not.

Didn't trip any warning and the machine is still up and running
after 15 Hours so feel free to include:

Tested-by: K Prateek Nayak <kprateek.nayak@xxxxxxx>

Perhaps the comment can read something like:

/*
* A heavy entity can pull the avg_vruntime close to its
* vruntime post enqueue but the zero_vruntime point is
* only updated at the next update_deadline() / enqueue
* / dequeue.
*
* Until then, the sum_w_vruntime grow quadratically,
* proportional to the entity's weight (w_i) as:
*
* sum_w_vruntime -= (lag_i * (W + w_i) / W) * w_i
*
* If w_i > W, it is beneficial to pull the
* zero_vruntime towards the entity's vruntime (V_i)
* since the sum_w_vruntime would only grow by
* (lag_i * W) which consumes lesser bits than leaving
* the zero_vruntime at the pre-enqueue avg_vruntime.
*/
if (weight > load)
update_zero = true;

Feel free to reword as you see fit :-)

--
Thanks and Regards,
Prateek