|
@@ -1870,16 +1870,18 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
|
|
if (test_tsk_need_resched(curr))
|
|
if (test_tsk_need_resched(curr))
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
+ /* Idle tasks are by definition preempted by non-idle tasks. */
|
|
|
|
+ if (unlikely(curr->policy == SCHED_IDLE) &&
|
|
|
|
+ likely(p->policy != SCHED_IDLE))
|
|
|
|
+ goto preempt;
|
|
|
|
+
|
|
/*
|
|
/*
|
|
- * Batch and idle tasks do not preempt (their preemption is driven by
|
|
|
|
- * the tick):
|
|
|
|
|
|
+ * Batch and idle tasks do not preempt non-idle tasks (their preemption
|
|
|
|
+ * is driven by the tick):
|
|
*/
|
|
*/
|
|
if (unlikely(p->policy != SCHED_NORMAL))
|
|
if (unlikely(p->policy != SCHED_NORMAL))
|
|
return;
|
|
return;
|
|
|
|
|
|
- /* Idle tasks are by definition preempted by everybody. */
|
|
|
|
- if (unlikely(curr->policy == SCHED_IDLE))
|
|
|
|
- goto preempt;
|
|
|
|
|
|
|
|
if (!sched_feat(WAKEUP_PREEMPT))
|
|
if (!sched_feat(WAKEUP_PREEMPT))
|
|
return;
|
|
return;
|