Re: [PATCHSET v6] sched: Implement BPF extensible scheduler class

Linus Torvalds
2024-06-20T17:12:29Z

On Wed, 19 Jun 2024 at 22:07, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> And scx_next_task_picked() isn't pretty - as far as I understand, it's
> because there's only a "class X picked" callback ("pick_next_task()"),
> and no way to tell other classes they weren't picked.

I guess that could be a class callback, something like this:

p = class->pick_next_task(rq);
if (p)
if (p) {
- scx_next_task_picked(rq, p, class);
+ struct sched_class *prev = last->sched_class;
+ if (class != prev && prev->switch_class)
+ prev->switch_class(rq);
return p;
}

and that would be arguably much prettier. But maybe I've
mis-understood the reason for that scx_next_task_picked() thing.

Tejun?

Linus