Skip to content
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

Report TSC multiplier #147

Closed
dtaskoff opened this issue Jul 15, 2020 · 2 comments
Closed

Report TSC multiplier #147

dtaskoff opened this issue Jul 15, 2020 · 2 comments

Comments

@dtaskoff
Copy link

dtaskoff commented Jul 15, 2020

Since most recent CPUs have different TSC, and CPU frequencies, reading the TSC multiplier is essential, in order to report an accurate frequency.

I will try to implement this change myself, but any help would be appreciated, as well!

@dtaskoff
Copy link
Author

My bad, it seems like you're already doing this in get_info_*_multiplier, am I right?

@dtaskoff dtaskoff reopened this Jul 15, 2020
@anrieff
Copy link
Owner

anrieff commented Jul 15, 2021

Yes, there are two ways to read the true CPU frequency:

  • cpu_clock_by_ic() - which does not care about TSC multipliers and all - just a busy loop with a predictable instruction throughput, so it is a real benchmark of what the CPU actually outputs;
  • RDMSR approach using get_info_*_multiplier and cpu_clock_by_mark() machinery

Both are valid.

@anrieff anrieff closed this as completed Jul 15, 2021
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

No branches or pull requests

2 participants