Re: [PATCH v2 04/14] sched_ext: Use per-CPU DSQs instead of per-node global DSQs in bypass mode

Tejun Heo
2025-11-10T21:59:42Z

Hello, Emil.

On Mon, Nov 10, 2025 at 04:43:23PM -0500, Emil Tsalapatis wrote:
> > @@ -1298,7 +1298,7 @@ static void do_enqueue_task(struct rq *rq, struct task_struct *p, u64 enq_flags,
> >
> > if (scx_rq_bypassing(rq)) {
> > __scx_add_event(sch, SCX_EV_BYPASS_DISPATCH, 1);
>
> Nit: The bypass label has a single statement, and there is no fallthrough to it.
> Can we just add the logic here:
>
> dsq = &task_rq(p)->scx.bypass_dsq;
> goto enqueue;
>
> and remove the new label?
>
> > - goto global;
> > + goto bypass;
> > }
> >
> > if (p->scx.ddsp_dsq_id != SCX_DSQ_INVALID)
> > @@ -1356,6 +1356,9 @@ static void do_enqueue_task(struct rq *rq, struct task_struct *p, u64 enq_flags,
> > global:
> > dsq = find_global_dsq(sch, p);
> > goto enqueue;
> > +bypass:
> > + dsq = &task_rq(p)->scx.bypass_dsq;
>
> Nit: If we keep the bypass label, we can remove the goto since the
> label is right below. Otherwise, we could remove it

This is really subjective but I like the fact that the local, global and
bypass labels look symmetric. It doesn't make any different to compilers and
I think keeping them so is less likely to trip up people.

Thanks.

--
tejun