[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] sched: print information about scheduler granularity



On Fri, 2020-04-17 at 09:57 +0200, Jürgen Groß wrote:
> On 16.04.20 18:43, Dario Faggioli wrote:
> > On Thu, 2020-04-16 at 09:33 +0100, Sergey Dyasli wrote:
> > > 
> > > +char *sched_gran_str(char *str, size_t size)
> > > +{
> > > +    char *mode = "";
> > > +
> > > +    switch ( opt_sched_granularity )
> > > +    {
> > > +    case SCHED_GRAN_cpu:
> > > +        mode = "cpu";
> > > +        break;
> > > +    case SCHED_GRAN_core:
> > > +        mode = "core";
> > > +        break;
> > > +    case SCHED_GRAN_socket:
> > > +        mode = "socket";
> > > +        break;
> > > +    default:
> > > +        ASSERT_UNREACHABLE();
> > > +        break;
> > > +    }
> > > +
> > > +    if ( sched_granularity )
> > > +        snprintf(str, size, "%u-way %s", sched_granularity,
> > > mode);
> > > 
> > I'm not sure about using the value of the enum like this.
> 
> enum? sched_granularity holds the number of cpus per scheduling
> resource. opt_sched_granularity is the enum.
> 
Ah, indeed! I failed to see that the if and the snprintf above use
that, and not opt_sched_granularity! Sorry for the confusion.

> > So I'd just go with "cpu", "core" and "socket" strings.
> 
> No, this is not a good idea. With e.g. smt=0 you'll be able to have
> "1-way core" which is much more informative than "core".
> 
True. And thinking to this cases, I agree that it makes sense to
provide an information that takes that into account too.

I'm now not sure whether something like "1-way core-scheduling (or "1-
way core-scheduling more") is really the best way to tell the user
we're using using core-scheduling, but we have disabled SMT... Perhaps
something like:

Scheduling granularity: core, 1CPU(s) per sched-resource

Or something like that?

Regards
-- 
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)

Attachment: signature.asc
Description: This is a digitally signed message part


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.