aboutsummaryrefslogtreecommitdiffstats
path: root/rust/helpers.c
diff options
context:
space:
mode:
authorTejun Heo <[email protected]>2024-06-26 01:29:58 +0000
committerPeter Zijlstra <[email protected]>2024-07-04 13:59:52 +0000
commitd329605287020c3d1c3b0dadc63d8208e7251382 (patch)
tree8e96bade108c8790c2f317621c616c085ad62c83 /rust/helpers.c
parentsched/psi: Optimise psi_group_change a bit (diff)
downloadkernel-d329605287020c3d1c3b0dadc63d8208e7251382.tar.gz
kernel-d329605287020c3d1c3b0dadc63d8208e7251382.zip
sched/fair: set_load_weight() must also call reweight_task() for SCHED_IDLE tasks
When a task's weight is being changed, set_load_weight() is called with @update_load set. As weight changes aren't trivial for the fair class, set_load_weight() calls fair.c::reweight_task() for fair class tasks. However, set_load_weight() first tests task_has_idle_policy() on entry and skips calling reweight_task() for SCHED_IDLE tasks. This is buggy as SCHED_IDLE tasks are just fair tasks with a very low weight and they would incorrectly skip load, vlag and position updates. Fix it by updating reweight_task() to take struct load_weight as idle weight can't be expressed with prio and making set_load_weight() call reweight_task() for SCHED_IDLE tasks too when @update_load is set. Fixes: 9059393e4ec1 ("sched/fair: Use reweight_entity() for set_user_nice()") Suggested-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Tejun Heo <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: [email protected] # v4.15+ Link: http://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'rust/helpers.c')
0 files changed, 0 insertions, 0 deletions