diff options
| author | Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> | 2026-11-23 00:12:13 +0000 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2026-11-26 19:12:10 +0100 |
| commit | 029fd68a263364583b6f9b34d22761acf0a3940c (patch) | |
| tree | 698da24a684976ad6c32d27156e1bd9758bf2d3a /tools/lib/python | |
| parent | 40fddc398878c2cf661b7f16d783bfc5b0000642 (diff) | |
sched/fair: Fix h_nr_runnable leak in dequeue_hierarchy()
Commit 486c3d06b902 ("sched/fair: Avoid transient double accounting
for delayed tasks") changed the h_nr_runnable logic in
dequeue_hierarchy() from "set to 1 unless delayed" to "set to 0 if
delayed", but left the initialiser at 0:
int h_nr_runnable = 0;
...
if (se->sched_delayed)
h_nr_runnable = 0;
h_nr_runnable is therefore always 0, so dequeuing a task that is not
delayed no longer decrements cfs_rq->h_nr_runnable. The count only
grows, which inflates se->runnable_weight and skews PELT runnable_avg
and load balancing.
Initialise h_nr_runnable to 1 so that only delayed tasks, which
set_delayed() has already accounted for, skip the decrement.
Fixes: 486c3d06b902 ("sched/fair: Avoid transient double accounting for delayed tasks")
Closes: https://lore.kernel.org/oe-lkp/202611230853.e2e6401-lkp@intel.com
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: Chen Yu <yu.c.chen@intel.com>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Tested-by: Alexey Charkov <alchark@flipper.net>
Tested-by: Vlad Poenaru <vlad.wing@gmail.com>
Link: https://patch.msgid.link/20261123001213.7609-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
