Re: [PATCH 0/9] Add CPU-type to topology

Ricardo Neri
2024-06-27T15:18:07Z

On Wed, Jun 19, 2024 at 11:22:16PM +0200, Brice Goglin wrote:

[...]

> > There can be many ways to expose this information in sysfs. Like this ...
> >
> > > [1] https://lkml.org/lkml/2020/10/2/1208
> > ... exposes /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.
> >
> > The other way is to expose the CPU-type in a file:
> >
> > /sys/devices/system/cpu/cpuN/type
> >
> > that could return the CPU-type of the CPU N. Is there a preference?
>
>
> I'd vote for the former.

+1. With the former you can read all CPUs of a given type in one go whereas
with the latter you have to iterate over all CPUs. By the time you are done
CPUs may have gone offline or online.