Skip to content

drivers core: Introduce CPU type sysfs interface

Ricardo Neri lkml oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 27 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4drivers core: Introduce CPU type sysfs interfaceDocumentation/ABI/testing/sysfs-devices-system-cpu drivers/base/cpu.c include/linux/cpu.h +1 more+240 -020 replies
2/4x86/cpu: Describe hybrid CPUs in cpuinfo_x86arch/x86/include/asm/processor.h arch/x86/kernel/cpu/common.c+16 -00 replies
3/4x86/cpu/intel: Add function to get name of hybrid CPU typesarch/x86/include/asm/intel-family.h arch/x86/kernel/cpu/cpu.h arch/x86/kernel/cpu/intel.c+30 -00 replies
4/4x86/cpu/topology: Implement the CPU type sysfs interfacearch/x86/include/asm/topology.h arch/x86/kernel/cpu/topology.c+25 -03 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchTony Luck
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] drivers core: Introduce CPU type sysfs interface

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).

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.

Patch 1 of the series proposes the generic interface, with hooks that architectures can override to suit their needs. The three patches patches implement such interface for x86 (as per request from Boris, I pulled patch 2 from a separate submission [1]).

Thanks and BR,
Ricardo

[1]. https://lkml.org/lkml/2020/10/2/1013

Ricardo Neri (4):
drivers core: Introduce CPU type sysfs interface x86/cpu: Describe hybrid CPUs in cpuinfo_x86 x86/cpu/intel: Add function to get name of hybrid CPU types x86/cpu/topology: Implement the CPU type sysfs interface

 .../ABI/testing/sysfs-devices-system-cpu      |  13 ++
 arch/x86/include/asm/intel-family.h           |   4 +
 arch/x86/include/asm/processor.h              |  13 ++
 arch/x86/include/asm/topology.h               |   2 +
 arch/x86/kernel/cpu/common.c                  |   3 +
 arch/x86/kernel/cpu/cpu.h                     |   3 +
 arch/x86/kernel/cpu/intel.c                   |  23 ++
 arch/x86/kernel/cpu/topology.c                |  23 ++
 drivers/base/cpu.c                            | 214 ++++++++++++++++++
 include/linux/cpu.h                           |  12 +
 include/linux/cpuhotplug.h                    |   1 +
 11 files changed, 311 insertions(+)
Signature · 1 line
2.17.1