]> git.ipfire.org Git - thirdparty/linux.git/commit
sched/debug: Fix avg_vruntime() usage
authorPeter Zijlstra <peterz@infradead.org>
Wed, 1 Apr 2026 13:20:21 +0000 (15:20 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 2 Apr 2026 11:42:43 +0000 (13:42 +0200)
commite08d007f9d813616ce7093600bc4fdb9c9d81d89
tree9a8cd50efc0639603f837ac662a2fd64ec081a2a
parent1319ea57529e131822bab56bf417c8edc2db9ae8
sched/debug: Fix avg_vruntime() usage

John reported that stress-ng-yield could make his machine unhappy and
managed to bisect it to commit b3d99f43c72b ("sched/fair: Fix
zero_vruntime tracking").

The commit in question changes avg_vruntime() from a function that is
a pure reader, to a function that updates variables. This turns an
unlocked sched/debug usage of this function from a minor mistake into
a data corruptor.

Fixes: af4cf40470c2 ("sched/fair: Add cfs_rq::avg_vruntime")
Fixes: b3d99f43c72b ("sched/fair: Fix zero_vruntime tracking")
Reported-by: John Stultz <jstultz@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: John Stultz <jstultz@google.com>
Link: https://patch.msgid.link/20260401132355.196370805@infradead.org
kernel/sched/debug.c