Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched/fair: Fix math notation errors in avg_vruntime comment

The avg_vruntime comment contains a couple of mathematical notation
issues:

- The summation over w_i * (V - v_i) is written in an ambiguous form
- The delta term refers to v instead of v0, which is inconsistent
with the code and preceding explanation

Fix these to make the comment mathematically correct and consistent
with the implementation.

Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260114090035.19033-1-zhanxusheng@xiaomi.com

authored by

Zhan Xusheng and committed by
Peter Zijlstra
553255cc 8d737320

+2 -2
+2 -2
kernel/sched/fair.c
··· 613 613 * 614 614 * \Sum lag_i = 0 615 615 * \Sum w_i * (V - v_i) = 0 616 - * \Sum w_i * V - w_i * v_i = 0 616 + * \Sum (w_i * V - w_i * v_i) = 0 617 617 * 618 618 * From which we can solve an expression for V in v_i (which we have in 619 619 * se->vruntime): ··· 648 648 * \Sum w_i := cfs_rq->sum_weight 649 649 * 650 650 * Since zero_vruntime closely tracks the per-task service, these 651 - * deltas: (v_i - v), will be in the order of the maximal (virtual) lag 651 + * deltas: (v_i - v0), will be in the order of the maximal (virtual) lag 652 652 * induced in the system due to quantisation. 653 653 * 654 654 * Also, we use scale_load_down() to reduce the size.