]> bbs.cooldavid.org Git - net-next-2.6.git/commit
sched: fix sched_rt_rq_enqueue() resched idle
authorJohn Blackwood <john.blackwood@ccur.com>
Tue, 26 Aug 2008 19:09:43 +0000 (15:09 -0400)
committerIngo Molnar <mingo@elte.hu>
Thu, 28 Aug 2008 09:13:24 +0000 (11:13 +0200)
commitf3ade837808121ff8bab9c56725f4fe40ec85a56
treeeb9a8d87bff0a7d11eade583a7582e3c765e3b80
parent354879bb977e06695993435745f06a0f6d39ce2b
sched: fix sched_rt_rq_enqueue() resched idle

When sysctl_sched_rt_runtime is set to something other than -1 and the
CONFIG_RT_GROUP_SCHED kernel parameter is NOT enabled, we get into a state
where we see one or more CPUs idling forvever even though there are
real-time
tasks in their rt runqueue that are able to run (no longer throttled).

The sequence is:

- A real-time task is running when the timer sets the rt runqueue
    to throttled, and the rt task is resched_task()ed and switched
    out, and idle is switched in since there are no non-rt tasks to
    run on that cpu.

- Eventually the do_sched_rt_period_timer() runs and un-throttles
    the rt runqueue, but we just exit the timer interrupt and go back
    to executing the idle task in the idle loop forever.

If we change the sched_rt_rq_enqueue() routine to use some of the code
from the CONFIG_RT_GROUP_SCHED enabled version of this same routine and
resched_task() the currently executing task (idle in our case) if it is
a lower priority task than the higher rt task in the now un-throttled
runqueue, the problem is no longer observed.

Signed-off-by: John Blackwood <john.blackwood@ccur.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched_rt.c