Re: [PATCH 11/12] sched_ext: scx_qmap - Idle-check pinned tasks before direct dispatch

[email protected] Sat, 01 Aug 2026 09:06:43 +0000
Newsgroups dev.linux.lists.sched-ext
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(=
s) to consider:
- [Low] The BPF rodata variable `always_enq_immed` was made unused by the p=
atch and remains as dead code.
--

--- Patch [11]: [PATCH 11/12] sched_ext: scx_qmap - Idle-check pinned tasks=
 before direct dispatch ---
commit 8281293388fde26e27e2d80b5bd65cbae1161f07
Author: Tejun Heo <[email protected]>

sched_ext: scx_qmap - Idle-check pinned tasks before direct dispatch

This commit updates pick_direct_dispatch_cid() to perform idle checks on
pinned tasks before direct dispatching. Previously, pinned tasks were sent
straight to their only CPU without an idle check, which could lead to bounce
loops if the CPU was busy.

> diff --git a/tools/sched_ext/scx_qmap.bpf.c b/tools/sched_ext/scx_qmap.bp=
f.c
> index 8822ed11c0d8b..9a0321e84e88f 100644
> --- a/tools/sched_ext/scx_qmap.bpf.c
> +++ b/tools/sched_ext/scx_qmap.bpf.c
> @@ -230,9 +230,6 @@ static s32 pick_direct_dispatch_cid(struct task_struc=
t *p, s32 prev_cid,
>  	s32 cid;
>  	u32 i;
> =20
> -	if (!always_enq_immed && p->nr_cpus_allowed =3D=3D 1)
> -		return prev_cid;
> -

[Severity: Low]
With the removal of this check, the BPF rodata variable always_enq_immed is
no longer read anywhere in the BPF program.

Should the declaration and its userspace assignment also be removed to clean
up the remaining dead code?

tools/sched_ext/scx_qmap.bpf.c:
    const volatile bool always_enq_immed;

tools/sched_ext/scx_qmap.c:main()
    ...
    case 'I':
        skel->rodata->always_enq_immed =3D true;
    ...

>  	if (cmask_test(prev_cid, &qa.self_cids.mask) &&
>  	    cmask_test_and_clear(prev_cid, &qa.idle_cids.mask))
>  		return prev_cid;

--=20
Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260801085150.2697=
[email protected]?part=3D11