Re: [PATCH sched_ext/for-7.1-fixes] sched_ext: Call wakeup_preempt() in local_dsq_post_enq()
From: Tejun Heo
Date: Fri Apr 24 2026 - 13:21:53 EST
Hello, Kuba.
On Fri, Apr 24, 2026 at 09:22:44AM +0000, Kuba Piecuch wrote:
> @@ -1408,11 +1407,19 @@ static void local_dsq_post_enq(struct scx_sched *sch, struct scx_dispatch_q *dsq
> if ((enq_flags & SCX_ENQ_PREEMPT) && p != rq->curr &&
> rq->curr->sched_class == &ext_sched_class) {
> rq->curr->scx.slice = 0;
> - preempt = true;
> + resched_curr(rq);
> }
>
> - if (preempt || sched_class_above(&ext_sched_class, rq->curr->sched_class))
> - resched_curr(rq);
Hmm... I don't quite understand this part of the change. sched_class_above()
got separated out into its own case but why is it dropping resched_curr() on
SCX_ENQ_PREEMPT?
> + /*
> + * If @rq->next_class is currently idle, we need to bump it
> + * to &ext_sched_class using wakeup_preempt(). Otherwise, if we drop
> + * the rq lock later in the pick and an RT task wakes up on @rq,
> + * wakeup_preempt_idle() will be called during RT task wakeup and
> + * SCX won't have an opportunity to re-enqueue IMMED tasks from @rq's
> + * local DSQ.
As this was really subtle, I think it warrants documenting all cases here.
Thanks.
--
tejun