Re: [PATCH v25 1/9] sched: Make class_schedulers avoid pushing current, and get rid of proxy_tag_curr()

K Prateek Nayak
2026-03-18T17:55:49Z

Hello Peter,

On 3/18/2026 7:22 PM, Peter Zijlstra wrote:
>> @@ -7114,6 +7119,24 @@ static void __sched notrace __schedule(i
>> goto keep_resched;
>> }
>> }
>> +
>> + /*
>> + * When transitioning like:
>> + *
>> + * prev next
>> + * donor: B B
>> + * curr: A B

Even for curr going A -> C, we should do this.

Consider B is blocked on C which is in turn blocked on A. B gets picked
and proxies A first as a result of the wait chain (B -> C -> A)

A runs and does an unlock with a handoff to C clearing its blocked_on.
In schedule B is picked again but this time it proxies C.

A might be on the push list and was skipped last time around since
A->on_cpu = 1 but now that is gone and we should still do put_prev_task()
+ set_next_task().

>> + *
>> + * then put_prev_set_next_task() will not have done anything,
>> + * since B == B. However, A might have missed a RT/DL balance
>> + * opportunity due to being on_cpu.
>> + */
>> + if (next == rq->donor && next == prev_donor) {
>
> && next != prev
>
>> + next->sched_class->put_prev_task(rq, next, next);
>> + next->sched_class->set_next_task(rq, next, true);
>> + }
>> + } else {
>> + rq_set_donor(rq, next);
>> }
>> picked:
>> clear_tsk_need_resched(prev);

--
Thanks and Regards,
Prateek