Skip to content

Commit 15a8641

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
sched: rt-group: fix RR buglet
In tick_task_rt() we first call update_curr_rt() which can dequeue a runqueue due to it running out of runtime, and then we try to requeue it, of it also having exhausted its RR quota. Obviously requeueing something that is no longer on the runqueue will not have the expected result. Signed-off-by: Peter Zijlstra <[email protected]> Tested-by: Daniel K. <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent ad2a3f1 commit 15a8641

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kernel/sched_rt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,10 @@ static
549549
void requeue_rt_entity(struct rt_rq *rt_rq, struct sched_rt_entity *rt_se)
550550
{
551551
struct rt_prio_array *array = &rt_rq->active;
552+
struct list_head *queue = array->queue + rt_se_prio(rt_se);
552553

553-
list_move_tail(&rt_se->run_list, array->queue + rt_se_prio(rt_se));
554+
if (on_rt_rq(rt_se))
555+
list_move_tail(&rt_se->run_list, queue);
554556
}
555557

556558
static void requeue_task_rt(struct rq *rq, struct task_struct *p)

0 commit comments

Comments
 (0)