Re: [PATCH v2 0/8] sched_ext: Add p->scx.bpf_priv for O(1) task context lookup

From: Tejun Heo

Date: Fri Dec 04 2026 - 12:19:29 EST


Hello, Changwoo.

The following is a Claude-generated review of the scx_qmap and selftest
patches. It's fully AI-generated and I haven't vetted the points.

- 4/8: probe() is a syscall program which is never associated with the
struct_ops, so the test reaches both kfuncs only through the fallback
for unassociated programs. Also, every task is on the root scheduler
while it is loaded, so task_sched_id == sched_id holds whether or not
the task was switched to SCHED_EXT, and the test can't tell
scx_bpf_task_sched_id() from scx_bpf_sched_id(). Telling them apart
takes a sub-scheduler.

- 6/8: The comment above task_ctx_key and the description say that the
tag matters e.g. in qmap_dump_task(), but qmap_dump_task() reads task
storage directly and never reads p->scx.bpf_priv. The lookup_task_ctx()
caller which can be handed another scheduler's task is
qmap_core_sched_before().

- 7/8: ops.enable() counts every task, so the test fails when an unrelated
SCHED_EXT task is alive at attach. With one such task running:

Expected skel->bss->nr_enable == 3 (4 == 3)

sub_handoff filters on the target's pid and passes in the same setup.

- 8/8: The return values of scx_bpf_task_set_priv() in ops.enable() and of
scx_bpf_task_set_dsq_vtime() in ops.exit_task() are dropped. If either
write were refused, the matching stale value check would pass without
testing anything.

- 4/8, 7/8, 8/8: The tests compare getpid() or fork()'s return value
against p->pid, which doesn't hold in a non-initial pid namespace.

Only the 7/8 failure has been reproduced. The rest are from reading the
code.

Thanks.

--
tejun