Re: [PATCH 2/2] sched_ext: Fix missing post-enqueue handling in move_local_task_to_local_dsq()
From: Tejun Heo
Date: Thu Dec 11 2025 - 20:34:05 EST
On Thu, Dec 11, 2025 at 11:35:17PM +0000, Christian Loehle wrote:
> On 12/11/25 22:48, Tejun Heo wrote:
> > move_local_task_to_local_dsq() is used when moving a task from a non-local
> > DSQ to a local DSQ on the same CPU. It directly manipulates the local DSQ
> > without going through dispatch_enqueue() and was missing the post-enqueue
> > handling that triggers preemption when SCX_ENQ_PREEMPT is set or the
> > enqueued task should preempt a lower priority task.
> >
> > This was fine when the function was only used from consume_dispatch_q()
> > where the CPU is already vacant and looking for the next task. However, the
> > function is now also used by move_task_between_dsqs() which backs
> > scx_bpf_dsq_move() which may be called while the CPU is busy.
>
> When was this changed? I couldn't find the commit when looking briefly :/
4c30f5ce4f7a ("sched_ext: Implement scx_bpf_dispatch[_vtime]_from_dsq()")
which was v6.12, so upstream history-wise, the above paragraph isn't
accurate. It was broken from get-go. Will update the commit message. I'm
split on whether I should tag stable for it given that the usage pattern
isn't very common and there's some risk in the behavior change. Hmm... might
as well.
Thanks.
--
tejun