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

From: Phil Auld

Date: Tue Nov 24 2026 - 10:20:21 EST


On Tue, Nov 24, 2026 at 10:59:28AM +0100 Juri Lelli wrote:
> 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. :)
>

I did notice the lack of units on the fair files. I'd certainly go along
with adding the _ns to those at least. I don't have a strong preference
about them both being the same unit if they are properly named.

It probably makes sense but I leave it to people who know dl better to
say if sub-us configuration makes sense.


Cheers,
Phil

--