Re: [PATCH 01/13] sched_ext: Don't set ddsp_dsq_id during select_cpu in bypass mode

From: Tejun Heo
Date: Mon Nov 10 2025 - 11:19:15 EST


Hello,

On Mon, Nov 10, 2025 at 07:57:18AM +0100, Andrea Righi wrote:
> On Sun, Nov 09, 2025 at 08:31:00AM -1000, Tejun Heo wrote:
> > In the default CPU selection path used during bypass mode, select_task_rq_scx()
> > set p->scx.ddsp_dsq_id to SCX_DSQ_LOCAL to emulate direct dispatch. However,
> > do_enqueue_task() ignores ddsp_dsq_id in bypass mode and queues to the global
> > DSQ, leaving ddsp_dsq_id dangling. This triggers WARN_ON_ONCE() in
> > mark_direct_dispatch() if the task later gets direct dispatched.
>
> The patch makes sense and I was actually testing something similar to fix
> https://github.com/sched-ext/scx/issues/2758.
>
> However, in dispatch_enqueue() we're always clearing p->scx.ddsp_dsq_id
> (SCX_DSQ_INVALID), even when we're targeting the global DSQ due to bypass
> mode, so in this scenario we shouldn't see a stale ddsp_dsq_id. Am I
> missing something?

I think you're right. The bug fix part was a wrong assumption on my part.
Will update the description.

Thanks.

--
tejun