Skip to content

Commit 4cd57f9

Browse files
Juri LelliIngo Molnar
authored andcommitted
sched/deadline: Always enqueue on previous rq when dl_task_timer() fires
dl_task_timer() may fire on a different rq from where a task was removed after throttling. Since the call path is: dl_task_timer() -> enqueue_task_dl() -> enqueue_dl_entity() -> replenish_dl_entity() and replenish_dl_entity() uses dl_se's rq, we can't use current's rq in dl_task_timer(), but we need to lock the task's previous one. Tested-by: Wanpeng Li <wanpeng.li@linux.intel.com> Signed-off-by: Juri Lelli <juri.lelli@arm.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Kirill Tkhai <ktkhai@parallels.com> Cc: Juri Lelli <juri.lelli@gmail.com> Fixes: 3960c8c ("sched: Make dl_task_time() use task_rq_lock()") Link: http://lkml.kernel.org/r/1427792017-7356-1-git-send-email-juri.lelli@arm.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 07c54f7 commit 4cd57f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/sched/deadline.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer)
514514
unsigned long flags;
515515
struct rq *rq;
516516

517-
rq = task_rq_lock(current, &flags);
517+
rq = task_rq_lock(p, &flags);
518518

519519
/*
520520
* We need to take care of several possible races here:
@@ -569,7 +569,7 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer)
569569
push_dl_task(rq);
570570
#endif
571571
unlock:
572-
task_rq_unlock(rq, current, &flags);
572+
task_rq_unlock(rq, p, &flags);
573573

574574
return HRTIMER_NORESTART;
575575
}

0 commit comments

Comments
 (0)