Skip to content

Commit

Permalink
linux/cpukinds: add Intel "LowPower" PMU set
Browse files Browse the repository at this point in the history
Linux commit 9f4a39757c81d532f64232702537c53ad4092a5e added a new
PMU set of core called "lowpower":
"The upcoming ARL-H hybrid processor contains 2 different atom uarchs
 which have different PMU capabilities."

It's not totally clear to me if previous generations with LP-Ecore
(meteor and lunar lake) have different Ecore uarch, but they don't
expose different PMU sets anyway (but we are able to distinguish them
thanks to frequencies).

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Dec 4, 2024
1 parent 3a7153f commit 4b2a139
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/hwloc.doxy
Original file line number Diff line number Diff line change
Expand Up @@ -2473,7 +2473,7 @@ as reported by some <tt>cpufreq</tt> or ACPI drivers on Linux
</dd>
<dt>CoreType (x86)</dt>
<dd>A string describing the kind of core,
currently <tt>IntelAtom</tt> or <tt>IntelCore</tt>,
currently <tt>IntelAtom</tt>, <tt>IntelCore</tt> or <tt>IntelLowPower</tt>,
as reported by the x86 CPUID instruction and Linux PMU on some Intel processors.
</dd>
<dt>LinuxCapacity (Linux)</dt>
Expand Down
11 changes: 10 additions & 1 deletion hwloc/topology-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -4722,7 +4722,7 @@ look_sysfscpukinds(struct hwloc_topology *topology,
int max_without_basefreq = 0; /* any cpu where we have maxfreq without basefreq? */
char str[293];
char *env;
hwloc_bitmap_t atom_pmu_set, core_pmu_set;
hwloc_bitmap_t atom_pmu_set, core_pmu_set, lowp_pmu_set;
int maxfreq_enabled = -1; /* -1 means adjust (default), 0 means ignore, 1 means enforce */
int use_cppc_nominal_freq = -1; /* -1 means try, 0 no, 1 yes */
unsigned adjust_max = 10;
Expand Down Expand Up @@ -4842,6 +4842,7 @@ look_sysfscpukinds(struct hwloc_topology *topology,
/* look at Intel core/atom PMUs */
atom_pmu_set = hwloc__alloc_read_path_as_cpulist("/sys/devices/cpu_atom/cpus", data->root_fd);
core_pmu_set = hwloc__alloc_read_path_as_cpulist("/sys/devices/cpu_core/cpus", data->root_fd);
lowp_pmu_set = hwloc__alloc_read_path_as_cpulist("/sys/devices/cpu_lowpower/cpus", data->root_fd);
if (atom_pmu_set) {
hwloc_linux_cpukinds_register_one(topology, atom_pmu_set,
HWLOC_CPUKIND_EFFICIENCY_UNKNOWN,
Expand All @@ -4858,6 +4859,14 @@ look_sysfscpukinds(struct hwloc_topology *topology,
} else {
hwloc_bitmap_free(core_pmu_set);
}
if (lowp_pmu_set) {
hwloc_linux_cpukinds_register_one(topology, lowp_pmu_set,
HWLOC_CPUKIND_EFFICIENCY_UNKNOWN,
(char *) "CoreType", (char *) "IntelLowPower");
/* the cpuset is given to the callee */
} else {
hwloc_bitmap_free(lowp_pmu_set);
}

return 0;
}
Expand Down

0 comments on commit 4b2a139

Please sign in to comment.