Re: [PATCH] sched_ext: Provide a sysfs enable_seq counter

From: Andrea Righi
Date: Mon Sep 23 2024 - 12:34:34 EST


On Mon, Sep 23, 2024 at 12:00:07PM -0400, Phil Auld wrote:
> On Mon, Sep 23, 2024 at 05:32:15AM -1000 Tejun Heo wrote:
> > Hello,
> >
> > On Mon, Sep 23, 2024 at 12:45:48PM +0200, Phil Auld wrote:
> > ...
> > > It's not a per scheduler counter, though. It's global. We want to know
> >
> > Yeah, the sequence is global but we can report the sequence at which a given
> > scheduler is loaded on each scheduler. That way, e.g., you can tell whether
> > a particular scheduler instance is the same one you looked at the last time
> > too.
> >
> > > that a (any) scx scheduler has been loaded at some time in the past. It's
> > > really only interesting when 0 or > 0. The actual non-zero number and which
> > > scheduler(s) don't matter that much.
> >
> > Not necessarily. e.g. You can also detect scheduler failing or being updated
> > for other reasons.
>
> Sure, but the primary purpose is practically boolean.
>
> >
> > > And it needs to persist when the scheduler is unloaded (I didn't look but
> > > I uspect the per scheduler attrs come and go?).
> >
> > Yes, the load sequence number should stay persistent across all schedulers,
> > but each scheduler should report the sequence number at which *it* was
> > loaded. Note that this doesn't really change anything now. If you only care
> > whether any SCX scheduler has ever been loaded, you'd always look under
> > root.
> >
>
> In my testing root is not there is nothing is loaded.

Right, there's no root if no sched_ext scheduler is loaded. Maybe we
should always keep root present, or have a global counter and one
per-sched?

-Andrea