linux/tools
Tejun Heo 05909810a9 tools/sched_ext: scx_qmap: Silence task_ctx lookup miss
scx_fork() dispatches ops.init_task to exactly one scheduler - the one
owning the forking task's cgroup. A task forked inside a sub-scheduler's
cgroup is init'd into the sub only; the root scheduler has no task_ctx
entry for it. When that task later appears as @prev in the root's
qmap_dispatch() (or flows through core-sched comparison via task_qdist),
the bpf_task_storage_get() legitimately misses.

qmap treated those misses as fatal via scx_bpf_error("task_ctx lookup
failed") and aborted the scheduler as soon as the first cross-sched
task hit the root. Drop the error in the sites where the miss is
legitimate: lookup_task_ctx() (helper; callers already check for NULL),
qmap_dispatch()'s @prev branch (bookkeeping-only), task_qdist()
(returns 0 which makes the comparison a no-op), and qmap_select_cpu()
(returns prev_cpu as a no-op fallback instead of -ESRCH). The existing
scx_error was a paranoid guard from the pre-sub-sched world where every
task was owned by the one and only scheduler.

v2: qmap_select_cpu() returns prev_cpu on NULL instead of -ESRCH, so
    the root scheduler doesn't error on cross-sched tasks that pass
    through it (Andrea Righi).

Fixes: 4f8b122848 ("sched_ext: Add basic building blocks for nested sub-scheduler dispatching")
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Reviewed-by: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
2026-04-21 06:18:58 -10:00
..
accounting delayacct: fix build regression on accounting tool 2026-02-12 15:45:56 -08:00
arch - Complete LASS enabling: deal with vsyscall and EFI 2026-04-14 14:24:45 -07:00
bootconfig tools/bootconfig: fix fd leak in load_xbc_file() on fstat failure 2026-03-19 08:43:06 +09:00
bpf bpftool: add missing fsession to the usage and docs of bpftool 2026-04-12 12:42:38 -07:00
build RTLA patches for v7.1: 2026-04-15 17:48:24 -07:00
certs
cgroup
counter
crypto
debugging
dma
docs docs: kdoc_diff: add a helper tool to help checking kdoc regressions 2026-03-30 10:54:13 -06:00
firewire
firmware
gpio
hv
iio
include mm.git review status for linus..mm-stable 2026-04-15 12:59:16 -07:00
kvm/kvm_stat
laptop
leds
lib mm.git review status for linus..mm-stable 2026-04-15 12:59:16 -07:00
memory-model
mm
net tools: ynl: add sample for wireguard 2026-04-14 11:48:04 -07:00
objtool objtool updates for v7.1: 2026-04-14 13:00:04 -07:00
pcmcia
perf RISC-V updates for v7.0-rc8 2026-04-10 17:27:08 -07:00
power Power management updates for 7.1-rc1 2026-04-13 19:47:52 -07:00
rcu
sched
sched_ext tools/sched_ext: scx_qmap: Silence task_ctx lookup miss 2026-04-21 06:18:58 -10:00
scripts Kbuild/Kconfig updates for 7.1 2026-04-14 09:18:40 -07:00
sound
spi spi: tools: Add include folder to .gitignore 2026-02-09 12:27:31 +00:00
testing selftests/sched_ext: Add non_scx_kfunc_deny test 2026-04-20 07:57:29 -10:00
thermal
time
tracing RTLA patches for v7.1: 2026-04-15 17:48:24 -07:00
unittests docs: kdoc: better handle source when producing YAML output 2026-03-25 13:36:46 -06:00
usb
verification rv: Allow epoll in rtapp-sleep monitor 2026-04-01 15:18:30 +02:00
virtio
wmi
workqueue tools/workqueue: add CACHE_SHARD support to wq_dump.py 2026-04-01 10:24:18 -10:00
writeback
Makefile