Re: [PATCH v4 3/6] sched: Add sysfs files for the per-CPU fair_server knobs

From: Juri Lelli

Date: Tue Nov 24 2026 - 04:59:41 EST


On 24/11/26 09:08, Sebastian Andrzej Siewior wrote:
> On 2026-11-24 08:56:11 [+0100], Juri Lelli wrote:
> > Hello,
> >
> > On 23/11/26 14:41, Sebastian Andrzej Siewior wrote:
> > > The fair_server exposes the runtime and period knobs per-CPU in the
> > > debugfs folder. The debugfs interface is not a stable ABI.
> > > Make the /sys/kernel/debug/sched/fair_server/cpu*/{period|runtime} knobs
> > > available as /sys/kernel/sched/cpuX/{fair_server_period|fair_server_runtime}.
> > >
> > > It adds a struct kobject to the rq and exposes only those two. The
> > > per-runqueue folder is named `cpu' rather than `rq' since it might be
> > > more intuitive to the user than `rq' or `runqueue'.
> > >
> > > The set logic is pulled from the debugfs folder but it is still shared.
> > > That debugfs logic could be removed (after providing the same for
> > > ext-server) or symlinked for a while.
> >
> > ...
> >
> > > +static ssize_t rq_fair_server_runtime_show(struct kobject *kobj, struct kobj_attribute *attr,
> > > + char *buf)
> > > +{
> > > + struct rq *rq = kobj_to_rq(kobj);
> > > + struct sched_dl_entity *dl_se;
> > > +
> > > + dl_se = &rq->fair_server;
> > > +
> > > + return sysfs_emit(buf, "%llu\n", dl_se->dl_runtime);
> > > +}
> >
> > Since these files are new and meant to replace debugfs, how about using
> > ns everywhere (you partly commented about it in the cover letter), as
> > sched_attr and the dl_server parameters already do, with the unit in the
> > name? I.e. fair_server_{runtime,period}_ns here and
> > dl_{runtime,period}_ns in 2/6, with only the procfs compatibility path
> > converting from us. Right now /sys/kernel/sched/ has dl_*_us in us next
> > to cpuX/fair_server_* in ns without a suffix.
>
> I can do both in ns (or us depending what is easier/ more useful). Let
> me update that then.

Mind that it would be nice to hear from others in this thread before I
make you do changes that others might not agree with. :)