Re: [PATCH 14/31] sched_ext: Implement BPF extensible scheduler class

From: Tejun Heo
Date: Tue Dec 13 2022 - 12:32:55 EST


Hello,

On Tue, Dec 13, 2022 at 11:57:12AM +0100, Peter Zijlstra wrote:
> > Given that UP doesn't need to transfer tasks across, it might be possible to
> > move the whole dispatch operation into ->pick_next_task() but the current
> > state would be different, so it's more complicated and will likely be more
> > brittle.
>
> That sounds like something is amiss, you fundamentally hold all the
> right locks, there is only one.

Yeah, locking is not the problem on UP. It's more that balance() is before
put_prev_task() and pick_next_task() after, so the %current task state is
different between the two points. I'll see if I can sqaure that from SCX
side. I don't see a reason why it wouldn't be possible but it's likely more
complicated than adding a call in the same spot for UP.

Thanks.

--
tejun