android_kernel_xiaomi_sm8350/kernel/sched
Nicolas Saenz Julienne 91732a2794 nohz/full, sched/rt: Fix missed tick-reenabling bug in dequeue_task_rt()
[ Upstream commit 5c66d1b9b30f737fcef85a0b75bfe0590e16b62a ]

dequeue_task_rt() only decrements 'rt_rq->rt_nr_running' after having
called sched_update_tick_dependency() preventing it from re-enabling the
tick on systems that no longer have pending SCHED_RT tasks but have
multiple runnable SCHED_OTHER tasks:

  dequeue_task_rt()
    dequeue_rt_entity()
      dequeue_rt_stack()
        dequeue_top_rt_rq()
	  sub_nr_running()	// decrements rq->nr_running
	    sched_update_tick_dependency()
	      sched_can_stop_tick()	// checks rq->rt.rt_nr_running,
	      ...
        __dequeue_rt_entity()
          dec_rt_tasks()	// decrements rq->rt.rt_nr_running
	  ...

Every other scheduler class performs the operation in the opposite
order, and sched_update_tick_dependency() expects the values to be
updated as such. So avoid the misbehaviour by inverting the order in
which the above operations are performed in the RT scheduler.

Fixes: 76d92ac305 ("sched: Migrate sched to use new tick dependency mask model")
Signed-off-by: Nicolas Saenz Julienne <nsaenzju@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <vschneid@redhat.com>
Reviewed-by: Phil Auld <pauld@redhat.com>
Link: https://lore.kernel.org/r/20220628092259.330171-1-nsaenzju@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-25 11:17:36 +02:00
..
autogroup.c
autogroup.h
clock.c
completion.c
core.c
cpuacct.c
cpudeadline.c
cpudeadline.h
cpufreq_schedutil.c
cpufreq.c
cpupri.c
cpupri.h
cputime.c
deadline.c
debug.c sched/debug: Remove mpol_get/put and task_lock/unlock from sched_show_numa 2022-04-15 14:18:06 +02:00
fair.c sched/fair: Fix cfs_rq_clock_pelt() for throttled cfs_rq 2022-06-14 18:11:33 +02:00
features.h sched/rt: Disable RT_RUNTIME_SHARE by default 2022-07-21 20:59:18 +02:00
idle.c
isolation.c
loadavg.c
Makefile
membarrier.c
pelt.c
pelt.h sched/fair: Fix cfs_rq_clock_pelt() for throttled cfs_rq 2022-06-14 18:11:33 +02:00
psi.c
rt.c nohz/full, sched/rt: Fix missed tick-reenabling bug in dequeue_task_rt() 2022-08-25 11:17:36 +02:00
sched-pelt.h
sched.h sched/fair: Fix cfs_rq_clock_pelt() for throttled cfs_rq 2022-06-14 18:11:33 +02:00
stats.c
stats.h
stop_task.c
swait.c
topology.c sched/topology: Fix sched_domain_topology_level alloc in sched_init_numa() 2022-03-08 19:07:48 +01:00
wait_bit.c
wait.c