Skip to content

Conversation

@mikethebos
Copy link

https://github.com/erpalma/throttled/issues/107
I fixed my HWP mode issue by using x86_energy_perf_policy to set hints.

@erpalma
Copy link
Owner

erpalma commented Mar 12, 2019

This is not the right way to "fix" your issue. That subprocess call has higher overhead than regular code plus using shell=True is not a great idea in general. HWP_Mode is loaded from the AC profile only thus we should replicate it to the BATTERY profile at least.

@mikethebos
Copy link
Author

mikethebos commented Mar 12, 2019

Debian 9 "stretch" does not implement the Intel p_state driver in the cpufreq package, so this was the most convenient method I could find. Plus, I added to improve efficiency:
exit_event_wait()

@erpalma
Copy link
Owner

erpalma commented Mar 13, 2019

If you don't have the p_state driver, then you can't control the hardware p-states, unless I'm missing something...

@mikethebos
Copy link
Author

Incorrect, according to: http://manpages.ubuntu.com/manpages/bionic/man8/x86_energy_perf_policy.8.html

x86_energy_perf_policy displays and updates energy-performance policy settings specific to
       Intel  Architecture  Processors.   Settings are accessed via Model Specific Register (MSR)
       updates, no matter if the Linux cpufreq sub-system is enabled or not.

@erpalma
Copy link
Owner

erpalma commented Mar 14, 2019

Ok I missed that x86_energy_perf_policy was using MSR directly. Still, to be consistent I prefer to replace the subprocess call with a piece of code writing the correct MSR.

@mikethebos
Copy link
Author

mikethebos commented Mar 14, 2019

C code

@mikethebos
Copy link
Author

Let me know if you need help with the MSR... I can test if needed...
I recommend that you make 2 new config parameters like the following:

HWP_FALLBACK_AC: balance-performance
HWP_FALLBACK_BATT: balance-power

@erpalma
Copy link
Owner

erpalma commented Mar 16, 2019

Why do you need a separate entry for fallback? Still, HWP is quite tricky because is also set by tlp. The detection code that I use is quite ugly and it is not that much fail safe I guess, but it works and I don't see a better way of doing it.

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