Skip to content

Exclude non-hybrid CPUs from intel-lpmd via cpu_hybrid check - #287

Open
hotline1337 wants to merge 2 commits into
CachyOS:masterfrom
hotline1337:fix/intel-lpmd-hybrid-cpus
Open

hotline1337 wants to merge 2 commits into
CachyOS:masterfrom
hotline1337:fix/intel-lpmd-hybrid-cpus

Conversation

@hotline1337

@hotline1337 hotline1337 commented Oct 8, 2026 •

Copy link
Copy Markdown

Summary

  • Adds a generic cpu_hybrid profile key: cpu_hybrid = true only matches systems whose CPU is hybrid (has E-cores).
  • Sets cpu_hybrid = true on the intel-lpmd profile, so it no longer matches non-hybrid CPUs that share the same cpu_family/cpu_models.
  • Does not carry over the blacklisted_device_ids approach from Add blacklisted IDs and exclude non-hybrid CPUs from intel-lpmd #286.

Context

This is a rework of #286 based on feedback and discussion on Discord.

The previous approach (maintaining a device blacklist) was rejected as fragile and unmaintainable. Instead, as suggested by maintainers, this PR implements a generic detection mechanism using the Atom PMU sysfs interface (/sys/devices/cpu_atom).

How the check works

On hybrid CPUs the kernel registers the Atom (E-core) perf PMU under /sys/devices/cpu_atom, next to the cpu_core (P-core) PMU, while non-hybrid CPUs only expose the unified cpu PMU.

The directory alone is not a reliable signal, though: non-hybrid dies of hybrid SoCs (e.g. Alder Lake-S without E-cores, such as the i5-12400F) still expose /sys/devices/cpu_atom, but their cpus file contains no CPU at all (just a line feed). hwd_misc::is_hybrid_cpu() therefore reads /sys/devices/cpu_atom/cpus, and requires the file to actually contain a CPU number; a missing or unreadable file counts as non-hybrid.

Changes

  1. src/hwd_misc.rs: added is_hybrid_cpu().
  2. src/profile.rs: cpu_hybrid is read in parse_profile() and emitted in profile_into_toml().
  3. src/data.rs: profiles with cpu_hybrid set are only matched when the detected hybridness agrees.
  4. profiles/pci/power_management/profiles.toml: intel-lpmd sets cpu_hybrid = true.
  5. tests/profiles/cpu-profile-test.toml + unit tests for the detection (with E-cores / without E-cores / missing PMU).

Verification

  • cargo fmt --all -- --check, cargo clippy --all-targets -- -D warnings and cargo test all pass.
  • Verified on an i5-12400F (6P+0E, non-hybrid): /sys/devices/cpu_atom/cpus contains only 0x0A and is_hybrid_cpu() returns false, so intel-lpmd is no longer offered there.

Comment thread src/hwd_misc.rs Outdated
Comment thread src/hwd_misc.rs Outdated
Comment thread src/hwd_misc.rs Outdated
@hotline1337
hotline1337 force-pushed the fix/intel-lpmd-hybrid-cpus branch from ffe4593 to 73ea542 Compare October 8, 2026 16:42
@hotline1337
hotline1337 requested a review from ventureoo October 8, 2026 16:47
Comment thread src/hwd_misc.rs Outdated
Comment thread src/hwd_misc.rs Outdated
Comment thread src/hwd_misc.rs Outdated
@hotline1337
hotline1337 force-pushed the fix/intel-lpmd-hybrid-cpus branch from 73ea542 to 982464c Compare October 9, 2026 20:10
@hotline1337
hotline1337 requested a review from ventureoo October 9, 2026 20:12
Add a generic cpu_hybrid profile key which requires the running CPU to
be hybrid (have E-cores). The cpus file of the Atom (E-core) perf PMU at
/sys/devices/cpu_atom is relied upon instead of blacklisting individual
device IDs: the file has to contain a CPU number, since non-hybrid dies
of hybrid SoCs (e.g. Alder Lake-S without E-cores) still expose the PMU
without any Atom CPU in its cpus list.
intel-lpmd only supports hybrid Intel CPUs (with E-cores), but the
cpu_family/cpu_models filter also matches non-hybrid Alder Lake
SKUs sharing the same family and model, so the daemon was installed and
exited immediately on those systems. Set cpu_hybrid for the profile to
skip them generically.
@hotline1337
hotline1337 force-pushed the fix/intel-lpmd-hybrid-cpus branch from 982464c to 3bb4472 Compare October 9, 2026 20:44
@ventureoo
ventureoo requested a review from vnepogodin October 10, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants