kernel_samsung_a53x/kernel/sched
Tejun Heo 799aef6e9d sched/fair: set_load_weight() must also call reweight_task() for SCHED_IDLE tasks
commit d329605287020c3d1c3b0dadc63d8208e7251382 upstream.

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) <peterz@infradead.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org # v4.15+
Link: http://lkml.kernel.org/r/20240624102331.GI31592@noisy.programming.kicks-ass.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-23 23:20:12 +01:00
..
ems kernel: sched: ems: drop usage of SCHED_FEAT 2024-11-19 17:52:14 +01:00
autogroup.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
autogroup.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clock.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
completion.c sched/completion: Expose wait_for_common*() to drivers 2024-11-17 17:45:08 +01:00
core.c sched/fair: set_load_weight() must also call reweight_task() for SCHED_IDLE tasks 2024-11-23 23:20:12 +01:00
cpuacct.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpudeadline.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpudeadline.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpufreq.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpufreq_schedutil.c schedutil: Allow CPU frequency changes to be amended before they're set 2024-11-19 18:06:02 +01:00
cpupri.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpupri.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cputime.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
deadline.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
debug.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fair.c sched/fair: set_load_weight() must also call reweight_task() for SCHED_IDLE tasks 2024-11-23 23:20:12 +01:00
features.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
idle.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
isolation.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
loadavg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
membarrier.c sched/membarrier: reduce the ability to hammer on sys_membarrier 2024-11-18 12:13:39 +01:00
pelt.c kernel: sched: Provide more PELT half-life options 2024-11-17 17:41:17 +01:00
pelt.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
psi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rt.c sched/rt: Disallow writing invalid values to sched_rt_period_us 2024-11-18 22:25:32 +01:00
sched-pelt.h kernel: sched: Provide more PELT half-life options 2024-11-17 17:41:17 +01:00
sched.h sched/fair: set_load_weight() must also call reweight_task() for SCHED_IDLE tasks 2024-11-23 23:20:12 +01:00
sec_mpam.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sec_mpam_cpbm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sec_mpam_sysfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sec_mpam_sysfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stats.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stats.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stop_task.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
swait.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
topology.c sched/fair: Allow disabling sched_balance_newidle with sched_relax_domain_level 2024-11-19 12:27:00 +01:00
wait.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wait_bit.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00