diff options
author | Peter Zijlstra <peterz@infradead.org> | 2015-06-11 14:46:39 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-06-19 00:25:26 +0200 |
commit | 4c9a4bc89a9cca8128bce67d6bc8870d6b7ee0b2 (patch) | |
tree | abb5e04295a140ebe7c12ed16c6c8e70da8a33b1 /drivers/sbus | |
parent | sched: Use replace normalize_task() with __sched_setscheduler() (diff) | |
download | linux-4c9a4bc89a9cca8128bce67d6bc8870d6b7ee0b2.tar.xz linux-4c9a4bc89a9cca8128bce67d6bc8870d6b7ee0b2.zip |
sched: Allow balance callbacks for check_class_changed()
In order to remove dropping rq->lock from the
switched_{to,from}()/prio_changed() sched_class methods, run the
balance callbacks after it.
We need to remove dropping rq->lock because its buggy,
suppose using sched_setattr()/sched_setscheduler() to change a running
task from FIFO to OTHER.
By the time we get to switched_from_rt() the task is already enqueued
on the cfs runqueues. If switched_from_rt() does pull_rt_task() and
drops rq->lock, load-balancing can come in and move our task @p to
another rq.
The subsequent switched_to_fair() still assumes @p is on @rq and bad
things will happen.
By using balance callbacks we delay the load-balancing operations
{rt,dl}x{push,pull} until we've done all the important work and the
task is fully set up.
Furthermore, the balance callbacks do not know about @p, therefore
they cannot get confused like this.
Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: ktkhai@parallels.com
Cc: rostedt@goodmis.org
Cc: juri.lelli@gmail.com
Cc: pang.xunlei@linaro.org
Cc: oleg@redhat.com
Cc: wanpeng.li@linux.intel.com
Link: http://lkml.kernel.org/r/20150611124742.615343911@infradead.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/sbus')
0 files changed, 0 insertions, 0 deletions