-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #7: use intel_pstate/no_turbo to disable turboboost #29
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for this help!
There is one main problem, which is mostly a problem of specification in the issue that I filed for this. The issue is that no_turbo
is the cleanest way of disabling turbo only for users who are using the intel_pstate
driver. The user of the acpi_cpufreq
driver, which was the default up until a couple of years ago for Intel, is still very common and this approach will fail there (but the MSR will work, at least for hardware that supports it).
Is there any chance you can make this change see if the intel_pstate
path exists, and then uses this code, and only then otherwise falls back to the old msr approach?
If not I'll try to integration your changes with that approach myself.
uarch-bench.sh
Outdated
} | ||
|
||
|
||
function is_even { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, thanks for deleting this, this was just spuriously left over from some testing I was doing :).
uarch-bench.sh
Outdated
export VENDOR_ID=$(lscpu | grep 'Vendor ID' | egrep -o '[^ ]*$') | ||
export MODEL_NAME=$(lscpu | grep 'Model name' | sed -n 's/Model name:\s*\(.*\)$/\1/p') | ||
export SCALING_DRIVER=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver) | ||
export SCALING_GOVERNOR=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor) | ||
export NO_TURBO=$(cat /sys/devices/system/cpu/intel_pstate/no_turbo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the review overall comments, but we should handle the case where this path doesn't exist.
007e364
to
14ae807
Compare
@travisdowns Updated the Pull Request with the suggested changes 😄 |
@jinankjain - thanks! I rebased and merged this in 277ff77. I think this PR won't close automatically due to the rebase (different SHAs), so closing this now. Thanks again for your help and I look forward to any further contributions! |
Thanks @travisdowns for merging this. I was thinking of working on porting this MacOSX. I saw that there is an open issue. |
@jinankjain - that would be awesome! The primary difficulty for "full functionality", I think, would be porting over the |
@travisdowns How about using https://github.com/opcm/pcm instead of libpfc as it provides much generic interface for Mac, Windows or Linux etc? |
@jinankjain yes, sure. In fact I recall now that this was mentioned on the associated issue. I'm not sure if you can completely "replace" In principle, the user-mode parts of [1] Correct me if I'm wrong though! My current assumption is that reading the counters goes though an API which ultimately calls into the kernel and uses the functionality exposed by the kernel driver (or on Linux I think it can use the existing |
Using this would resolve the dependency on
msr-tools
to disable turbo boost.