android_kernel_google_msm/kernel/sched
Brian Silverman 36cddaebe7 sched: Fix RLIMIT_RTTIME when PI-boosting to RT
commit 746db9443ea57fd9c059f62c4bfbf41cf224fe13 upstream.

When non-realtime tasks get priority-inheritance boosted to a realtime
scheduling class, RLIMIT_RTTIME starts to apply to them. However, the
counter used for checking this (the same one used for SCHED_RR
timeslices) was not getting reset. This meant that tasks running with a
non-realtime scheduling class which are repeatedly boosted to a realtime
one, but never block while they are running realtime, eventually hit the
timeout without ever running for a time over the limit. This patch
resets the realtime timeslice counter when un-PI-boosting from an RT to
a non-RT scheduling class.

I have some test code with two threads and a shared PTHREAD_PRIO_INHERIT
mutex which induces priority boosting and spins while boosted that gets
killed by a SIGXCPU on non-fixed kernels but doesn't with this patch
applied. It happens much faster with a CONFIG_PREEMPT_RT kernel, and
does happen eventually with PREEMPT_VOLUNTARY kernels.

Signed-off-by: Brian Silverman <brian@peloton-tech.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: austin@peloton-tech.com
Link: http://lkml.kernel.org/r/1424305436-6716-1-git-send-email-brian@peloton-tech.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[lizf: Backported to 3.4: adjust contest]
Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-06-19 11:40:29 +08:00
..
auto_group.c Revert "sched, autogroup: Stop going ahead if autogroup is disabled" 2012-12-10 10:59:40 -08:00
auto_group.h Revert "sched, autogroup: Stop going ahead if autogroup is disabled" 2012-12-10 10:59:40 -08:00
clock.c sched_clock: Prevent 64bit inatomicity on 32bit systems 2013-04-16 21:27:27 -07:00
core.c sched: Fix RLIMIT_RTTIME when PI-boosting to RT 2015-06-19 11:40:29 +08:00
cpupri.c sched: Use CPUPRI_NR_PRIORITIES instead of MAX_RT_PRIO in cpupri check 2014-06-11 12:04:10 -07:00
cpupri.h
debug.c sched: Avoid throttle_cfs_rq() racing with period_timer stopping 2014-01-08 09:42:12 -08:00
fair.c sched: Fix double normalization of vruntime 2014-03-23 21:37:03 -07:00
features.h sched: Fix more load-balancing fallout 2012-04-26 12:54:52 +02:00
idle_task.c sched/nohz: Rewrite and fix load-avg computation -- again 2012-07-19 08:58:56 -07:00
Makefile
rt.c sched/rt: Reduce rq lock contention by eliminating locking of non-feasible target 2015-04-14 17:34:03 +08:00
sched.h sched/nohz: Fix rq->cpu_load[] calculations 2014-02-20 10:45:32 -08:00
stats.c sched: Remove sched_switch 2012-01-27 13:28:53 +01:00
stats.h
stop_task.c sched: Fix migration thread runtime bogosity 2012-10-13 05:39:01 +09:00