aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Lelli <juri.lelli@arm.com>2014-10-24 05:16:37 -0400
committerIngo Molnar <mingo@kernel.org>2014-10-28 05:46:00 -0400
commit64be6f1f5f710f5995d41caf8a1767fe6d2b5a87 (patch)
tree7f35a4ab8b313cac8bd882aa5595689167051857
parenteeb61e53ea19be0c4015b00b2e8b3b2185436f2b (diff)
sched/deadline: Don't replenish from a !SCHED_DEADLINE entity
In the deboost path, right after the dl_boosted flag has been reset, we can currently end up replenishing using -deadline parameters of a !SCHED_DEADLINE entity. This of course causes a bug, as those parameters are empty. In the case depicted above it is safe to simply bail out, as the deboosted task is going to be back to its original scheduling class anyway. Reported-by: Daniel Wagner <daniel.wagner@bmw-carit.de> Tested-by: Daniel Wagner <daniel.wagner@bmw-carit.de> Signed-off-by: Juri Lelli <juri.lelli@arm.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: vincent@legout.info Cc: Dario Faggioli <raistlin@linux.it> Cc: Michael Trimarchi <michael@amarulasolutions.com> Cc: Fabio Checconi <fchecconi@gmail.com> Link: http://lkml.kernel.org/r/1414142198-18552-4-git-send-email-juri.lelli@arm.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--kernel/sched/deadline.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 256e577faf1b..92279eaf0ef2 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -847,8 +847,19 @@ static void enqueue_task_dl(struct rq *rq, struct task_struct *p, int flags)
847 * smaller than our one... OTW we keep our runtime and 847 * smaller than our one... OTW we keep our runtime and
848 * deadline. 848 * deadline.
849 */ 849 */
850 if (pi_task && p->dl.dl_boosted && dl_prio(pi_task->normal_prio)) 850 if (pi_task && p->dl.dl_boosted && dl_prio(pi_task->normal_prio)) {
851 pi_se = &pi_task->dl; 851 pi_se = &pi_task->dl;
852 } else if (!dl_prio(p->normal_prio)) {
853 /*
854 * Special case in which we have a !SCHED_DEADLINE task
855 * that is going to be deboosted, but exceedes its
856 * runtime while doing so. No point in replenishing
857 * it, as it's going to return back to its original
858 * scheduling class after this.
859 */
860 BUG_ON(!p->dl.dl_boosted || flags != ENQUEUE_REPLENISH);
861 return;
862 }
852 863
853 /* 864 /*
854 * If p is throttled, we do nothing. In fact, if it exhausted 865 * If p is throttled, we do nothing. In fact, if it exhausted