Re: [PATCH 3/4] sched_ext: Wrap kfunc args in struct to prepare for aux__prog

From: Andrea Righi

Date: Tue Oct 07 2025 - 14:37:48 EST


On Tue, Oct 07, 2025 at 08:24:02AM -1000, Tejun Heo wrote:
> Hello,
>
> On Tue, Oct 07, 2025 at 11:48:44AM +0200, Andrea Righi wrote:
> > > +struct scx_bpf_dsq_insert_vtime_args {
> > > + /* @p can't be packed together as KF_RCU is not transitive */
> > > + u64 dsq_id;
> > > + u64 slice;
> > > + u64 vtime;
> > > + u64 enq_flags;
> > > +};
> >
> > With PATCH 2/4 introducing scx_bpf_task_set_slice() and
> > scx_bpf_task_set_dsq_vtime(), would it be reasonable to use those to set
> > these task properties and then completely get rid of these args in
> > scx_bpf_dsq_insert[_vtime]()?
>
> Maybe. However, the most common usage pattern is setting vtime and slice on
> insertion, so I think it makes sense to have a shortcut interface for that.
> Even if the overhead difference is negligible, it's nice to have a dedicated
> interface for the most common use case.

Yes, after talking about this during office hours, I agree that it's useful
to be able to set both vtime and slice when inserting a task. While the
overhead is likely negligible, it could still impact hot paths, so:

Acked-by: Andrea Righi <arighi@xxxxxxxxxx>

Thanks,
-Andrea