> -----Original Messages-----
> From: "Christian Loehle" <[email protected]>
> Send time:Friday, 19/06/2026 23:31:59
> To: "Nuoqi Gui" <[email protected]>, "Tejun Heo" <[email protected]>, 
> "David Vernet" <[email protected]>, "Alexei Starovoitov" <[email protected]>, 
> "Daniel Borkmann" <[email protected]>, "Andrii Nakryiko" 
> <[email protected]>
> Cc: "Andrea Righi" <[email protected]>, "Changwoo Min" <[email protected]>, 
> "Shuah Khan" <[email protected]>, [email protected], 
> [email protected], [email protected], 
> [email protected]
> Subject: Re: [PATCH bpf-next 0/2] sched_ext: Mark scx_bpf_cpu_rq() nullable
> 
> On 6/19/26 15:45, Nuoqi Gui wrote:
> > scx_bpf_cpu_rq() can return NULL for invalid CPU input or when no SCX
> > scheduler is active, but its kfunc registration does not advertise the
> > nullable return to the verifier.
> > 
> > Add KF_RET_NULL to scx_bpf_cpu_rq(), matching the nullable metadata already
> > present on neighboring SCX accessors, and add a sched_ext selftest that 
> > rejects
> > an unchecked direct runqueue field read.
> > 
> 
> See 5c48d88fe004 ("sched_ext: deprecation warn for scx_bpf_cpu_rq()")
> I guess I can send a patch to remove the function, it's been a while.
> 
> > This fixes a regression introduced by 6203ef73fa5c ("sched/ext: Add BPF
> > function to fetch rq").
> 
> How so?
> 
> > 
> > Signed-off-by: Nuoqi Gui <[email protected]>
> > ---
> > Nuoqi Gui (2):
> >       sched_ext: Mark scx_bpf_cpu_rq() as nullable
> >       selftests/sched_ext: Cover scx_bpf_cpu_rq() null return
> > 
> >  kernel/sched/ext.c                                 |  2 +-
> >  tools/testing/selftests/sched_ext/Makefile         |  1 +
> >  .../selftests/sched_ext/cpu_rq_ret_null.bpf.c      | 27 +++++++++++++++
> >  .../testing/selftests/sched_ext/cpu_rq_ret_null.c  | 38 
> > ++++++++++++++++++++++
> >  4 files changed, 67 insertions(+), 1 deletion(-)
> > ---
> > base-commit: e4287bf34f97a88c7d9322f5bde828724c073a6b
> > change-id: 20260617-f01-14-scx-cpu-rq-ret-null-2e79535acd57
> > 
> > Best regards,
> > --  
> > Nuoqi Gui <[email protected]>
> > 
> > 

Thanks, you're right. "Regression" was inaccurate; the missing KF_RET_NULL
metadata has been there since the kfunc was introduced by 6203ef73fa5c.

If the preferred direction is to remove scx_bpf_cpu_rq(), I'll drop this 
series.

Reply via email to