Re: [PATCH 5/5] sched: Rework sched_class::wakeup_preempt() and rq_modified_*()

From: Tejun Heo

Date: Tue Dec 02 2025 - 18:27:50 EST


Hello,

On Thu, Nov 27, 2025 at 04:39:48PM +0100, Peter Zijlstra wrote:
> @@ -2174,10 +2172,14 @@ void wakeup_preempt(struct rq *rq, struc
> {
> struct task_struct *donor = rq->donor;
>
> - if (p->sched_class == donor->sched_class)
> - donor->sched_class->wakeup_preempt(rq, p, flags);
> - else if (sched_class_above(p->sched_class, donor->sched_class))
> + if (p->sched_class == rq->next_class) {
> + rq->next_class->wakeup_preempt(rq, p, flags);
> +
> + } else if (sched_class_above(p->sched_class, rq->next_class)) {
> + rq->next_class->wakeup_preempt(rq, p, flags);
> resched_curr(rq);
> + rq->next_class = p->sched_class;
> + }

I wonder whether this is a bit subtle. Wouldn't it be clearer to add a
separate method which takes an explicit next_class argument for the second
case?

Thanks.

--
tejun