Re: [PATCH v33 7/7] sched/proxy: Add deactivated (sleeping) owner handling to find_proxy_task()

From: K Prateek Nayak

Date: Wed Oct 28 2026 - 23:27:37 EST


Hello Juri,

On 10/28/2026 4:06 PM, Juri Lelli wrote:
>> Ack! But this is only needed for wakeup so just:
>>
>> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
>> index c0ebdcde5fe5..20c388b55c50 100644
>> --- a/kernel/sched/deadline.c
>> +++ b/kernel/sched/deadline.c
>> @@ -2657,7 +2657,7 @@ static void migrate_task_rq_dl(struct task_struct *p, int new_cpu __maybe_unused
>> struct rq_flags rf;
>> struct rq *rq;
>>
>> - if (READ_ONCE(p->__state) != TASK_WAKING)
>> + if (task_on_rq_migrating(rq))
>> return;
>>
>> rq = task_rq(p);
>> ---
>>
>> should be enough then?
>
> It is enough, but I now fear too 'broad'? :)
>
> Looks like dl_task_offline_migration() ends up here via set_task_cpu();
> in that case the task was throttled and found the cpu was running on has
> been hotplugged so it needs a new cpu at replenishment. All bandwidth
> accouting is done by dl_task_offline_migration() itself, the task is not
> WAKING so migrate_task_rq_dl() has nothing to do and bails early
> correctly. If we use task_on_rq_migrating() it won't bail early anymore
> and double subtracting? Adding !p->is_blocked seems to cover this case
> as well?

Ack! '!task_on_migrating(p) && p->is_blocked' should cover all cases.

That said, the way dl_task_offline_migration() migrates the throttled
task off an offline rq is interesting :-)

--
Thanks and Regards,
Prateek