diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index fc6cd55f9d22..df8c9c2c7918 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9948,6 +9948,13 @@ static void wakeup_preempt_fair(struct rq *rq, struct task_struct *p, int wake_f if (unlikely(!normal_policy(p->policy))) goto update; + /* + * Do not preempt for tasks that are sched_delayed as it would violate + * EEVDF to forcibly queue an ineligible task. + */ + if (pse->sched_delayed) + goto update; + /* * If @p has a shorter slice than current and @p is eligible, override * current's slice protection in order to allow preemption. @@ -9959,11 +9966,9 @@ static void wakeup_preempt_fair(struct rq *rq, struct task_struct *p, int wake_f /* * Ignore wakee preemption on WF_FORK as it is less likely that - * there is shared data as exec often follow fork. Do not - * preempt for tasks that are sched_delayed as it would violate - * EEVDF to forcibly queue an ineligible task. + * there is shared data as exec often follow fork. */ - if ((wake_flags & WF_FORK) || pse->sched_delayed) + if (wake_flags & WF_FORK) goto update; /* Prefer picking wakee soon if appropriate. */