[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201007025019.GA27938@ranerica-svr.sc.intel.com>
Date: Tue, 6 Oct 2020 19:50:19 -0700
From: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
To: Qais Yousef <qais.yousef@....com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, x86@...nel.org,
Borislav Petkov <bp@...e.de>, Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Tony Luck <tony.luck@...el.com>,
Len Brown <len.brown@...el.com>,
"Ravi V. Shankar" <ravi.v.shankar@...el.com>,
linux-kernel@...r.kernel.org,
Dietmar Eggemann <dietmar.eggemann@....com>,
Morten Rasmussen <morten.rasmussen@....com>,
Quentin Perret <qperret@...gle.com>
Subject: Re: [PATCH 0/4] drivers core: Introduce CPU type sysfs interface
On Tue, Oct 06, 2020 at 09:51:53AM +0100, Qais Yousef wrote:
> Hi Ricardo
Hi Qais,
Thanks for chiming in.
>
> Adding some people who might be interested.
>
> On 10/02/20 18:17, Ricardo Neri wrote:
> > Hybrid CPU topologies combine processors with more than one type of
> > micro-architecture. Hence, it is possible that individual CPUs support
> > slightly different features (e.g., performance counters) and different
> > performance properties. Thus, there may be user space entities interested
> > in knowing the topology of the system based on the types of available
> > CPUs.
> >
> > Currently, there exists an interface for the CPU capacity (/sys/devices/
> > system/cpu/cpuX/cpu_capacity). However, CPU capacity does not always map
> > to CPU types (by the way, I will submit a separate series to bring such
> > interface to x86).
>
> Why do you need to do this mapping?
>
> >
> > This series proposes the new interface /sys/devices/system/cpu/types
> > which, in hybrid parts, creates a subdirectory for each type of CPU.
> > Each subdirectory contains a CPU list and a CPU map that user space can
> > query.
>
> Why user space needs to query this info?
>
> The rationale is missing the intention behind all of this. It seems you're
> expecting software to parse this info and take decisions based on that?
I propose this interface to be consumed for application or libraries
wanting to know the topology of the system. Perhaps, a utility program
that wants to depict CPUs by type. Another example is a policy manager
wanting to create a cgroup cpuset of CPUs of a given type for
performance reasons. Similarly, a program may want to affinitize itself
to a type of CPU, if for instance certain performance events are only
counted on a given CPU type.
Also, an interface with cpumasks makes it convenient for userspace to
not have to traverse each CPU individually.
a) add the type of each CPU in /proc/cpuinfo
b) add the type of each CPU in /sys/devices/system/cpu/cpu#/type
c) for performance, derive the CPU type from
/sys/devices/system/cpu/cpu#/cpu_capacity
d) add an interface similar to what I propose in this series.
None of this imply that certain instructions will be able to run on one
type of CPU but not on another. Instead, better performance may be
obtained on one type CPU vs another.
Thanks and BR,
Ricardo
Powered by blists - more mailing lists