Skip to contentSkip to conversation

sched/rt: Remove unnecessary check for next_task in push_rt_task()

PATCH Superseded Muchun Song 1 participant 1 message Nov 3, 2018 Scheduler

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched/rt: Remove unnecessary check for next_task in push_rt_task()

In push_rt_task(), we call pick_next_pushable_task() to pick next_task before the check. If next_task and rq->curr are equal, which will trigger BUG_ON() in pick_next_pushable_task(). See the following code in pick_next_pushable_task().

static struct task_struct *pick_next_pushable_task(struct rq *rq)

  {
	BUG_ON(task_current(rq, p));

}

The task_current() will check if task p and rq->curr are equal. So, we can remove the unnecessary check in push_rt_task().

---
 kernel/sched/rt.c | 5 -----
 1 file changed, 5 deletions(-)
kernel/sched/rt.c +0 -5
index 481bb7aa25c5..ec097edea9ca 100644
@@ -1813,11 +1813,6 @@ static int push_rt_task(struct rq *rq)
 		return 0;
 
 retry:
-	if (unlikely(next_task == rq->curr)) {
-		WARN_ON(1);
-		return 0;
-	}
-
 	/*
 	 * It's possible that the next_task slipped in of
 	 * higher priority than current. If that's the case
Signature · 1 line
2.17.1