Re: [PATCH 0/3] tools/sched_ext: Fix three example scheduler bugs

From: Tejun Heo

Date: Thu Sep 24 2026 - 12:47:42 EST


Hello, Wanwu.

On Thu, Sep 24, 2026 at 10:36:56PM +0800, Wanwu Li wrote:
> - try_dispatch() trusts a pid popped from a cgroup's FIFO. If the
> task migrated to another cgroup between enqueue and dispatch, it is
> dispatched under the old cgroup's context, violating the core
> "paired CPUs only run tasks from the same cgroup" invariant.

3/3 calls scx_bpf_task_cgroup() on a task from bpf_task_from_pid(). The
kfunc only accepts the tasks passed to the current op, so the scheduler
is disabled on its first dispatch:

sched_ext: BPF scheduler "pair" enabled
sched_ext: BPF scheduler "pair" disabled (runtime error)
sched_ext: pair: called on a task not being operated on
scx_bpf_task_cgroup+0x15b/0x160
bpf__sched_ext_ops_dispatch+0x47/0xa3

This means the patches were posted without being run at all. That's not
acceptable. Please reproduce each bug and verify that the fix resolves it
before posting.

Thanks.

--
tejun