Re: [PATCH v2 08/11] sched_ext: Add an event, BYPASS_DISPATCH

From: Tejun Heo
Date: Thu Jan 30 2025 - 07:25:09 EST


On Thu, Jan 30, 2025 at 03:26:16PM +0900, Changwoo Min wrote:
> Hello,
>
> On 25. 1. 28. 05:05, Tejun Heo wrote:
> > On Sun, Jan 26, 2025 at 07:16:11PM +0900, Changwoo Min wrote:
> > ...
> > > has_tasks:
> > > + if (scx_rq_bypassing(rq))
> > > + __scx_add_event(BYPASS_DISPATCH, 1);
> >
> > Can we do this at the sources even if that's a bit more code?
>
> Sure. I will remove scx_add_event() and __scx_add_event() and will use
> this_cpu_add() and __this_cpu_add() directly.

Oh, that's not what I meant. I meant that in the code quoted above, the stat
is being incremented in a spot where most code paths converge and then the
specific stat condition is being tested again. It'd be better to update the
stat where the condition is detected initially.

Thanks.

--
tejun