Re: [PATCH v23 7/9] sched: Have try_to_wake_up() handle return-migration for PROXY_WAKING case

From: John Stultz

Date: Thu Nov 20 2025 - 02:34:26 EST


On Wed, Nov 19, 2025 at 7:16 PM K Prateek Nayak <kprateek.nayak@xxxxxxx> wrote:
> On 11/20/2025 6:35 AM, John Stultz wrote:
> >> Sounds like block_task() would be better than deactivate_task() above
> >> in that case. Anything that is waiting on the task's state change takes
> >> the pi_lock afaik and the wakeup is always done with pi_lock held so
> >> blocking the task shouldn't cause any problems based on my reading.
> >
> > So earlier I did try using block_task() but it always seemed to run
> > into crashes, which I assumed was because other cpus were picking the
> > task up as it wasn't on_rq (any references to a task after
> > block_task() in other situations often runs into this trouble).
> >
> > But your point about the pi_lock being held is a good one, so I will
> > tinker and think a bit more on this.
>
> So if you hadn't used DEQUEUE_SPECIAL previously with block_task(),

Yeah, you're right, DEQUEUE_SPECIAL definitely solves the crashes I
was seeing without it.
I'll switch over to that.

thanks so much!
-john