Jump to content

CPU frequency reading from driver or hardware level?

On Linux, stuff like cpufreq-info report the CPU frequency from the software level I think. And programs like i7z read from hardware level I think. Is it better to read from software or hardware? Well, obviously hardware, but maybe software is better for a reason. First of all, yes, they both give me different results. The cpufreq one sometimes drops to 400Mhz and shows a little different clock speeds compared to i7z. I feel like reading from the software is better, because it will be the real effective clock speed that you are given to run your workload. Stuff like clock modulation is also affected in the readings. Is this correct, or am I an idiot not using i7z? And I still don't get why there is a much noticeable difference between both their clock speed reporting.

Microsoft owns my soul.

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

If you read the man page for cpufreq-info you'll see that it too can read straight from hardware with the -w flag.

As far as I can tell, the difference is that "software" polling will read the /proc/cpuinfo file (populated by the kernel) while "hardware" polling will get its reading from different sensors on the CPU (typically by reading values in architecture-specific registers); sometimes this makes absolutely no difference. On modern CPUs with boost and other power scaling functionality, the "hardware" reading is more likely to be the correct one.

Don't ask to ask, just ask... please聽馃え

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

I can see two advantages to the software approach: You don't need to care what type of hardware you're dealing with and if there are any hardware quirks, the kernel likely contains fixes that work around them already.

The disadvantage would be that you're bound to whatever interpretation of hardware values is baked into the kernel, while direct hardware access would give you more control how you want to interpret values.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now