Re: [PATCH 4/4] sched_ext: Make scx_bpf_dsq_insert*() return bool

From: Andrea Righi

Date: Tue Oct 07 2025 - 13:25:24 EST


On Tue, Oct 07, 2025 at 11:03:04AM -0400, Emil Tsalapatis wrote:
...
> > > +/*
> > > + * v6.19: scx_bpf_dsq_insert() now returns bool instead of void. Move
> > > + * scx_bpf_dsq_insert() decl to common.bpf.h and drop compat helper after v6.22.
> > > + */
> > > +bool scx_bpf_dsq_insert___new(struct task_struct *p, u64 dsq_id, u64 slice, u64 enq_flags) __ksym __weak;
> > > +void scx_bpf_dsq_insert___compat(struct task_struct *p, u64 dsq_id, u64 slice, u64 enq_flags) __ksym __weak;
> > > +
> > > +static inline bool
> > > +scx_bpf_dsq_insert(struct task_struct *p, u64 dsq_id, u64 slice, u64 enq_flags)
> > > +{
> > > + if (bpf_ksym_exists(scx_bpf_dsq_insert___new)) {
> >
> > I'm confused... where is scx_bpf_dsq_insert___new() defined?
> >
>
> CO:RE relocation ignores suffixes if there is no match, so
> scx_bpf_dsq_insert___new() defaults to scx_bpf_dsq_insert() in systems
> with this patch. When I tested it the symbol resolved to
> scx_bpf_dsq_insert(). We're not really matching the name, we're
> matching the signature and trying to find a kfunc with the the
> scx_bpf_dsq_insert prefix in its name.

I see, TIL. Thanks for clarifing this, Emil. With that:

Acked-by: Andrea Righi <arighi@xxxxxxxxxx>

-Andrea