Hardware questions about cores and threads and /proc/cpuinfo

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Isaac
Posts: 265
Joined: Sat Feb 22, 2014 8:37 pm

Hardware questions about cores and threads and /proc/cpuinfo

Post by Isaac »

I have a quad core i7 7700, so 4 real cores and 8 threads or virtual cores. In Linux when I do

Code: Select all

cat /proc/cpuinfo | grep MHz
I see 8 listed frequencies and they don't necessarily matches by pair. Without using grep, I can see that these frequencies are for core 0, 1, 2, 3, 0, 1, 2 and 3 in that order. In other words, they are the frequencies of the threads, not the frequencies of real cores. But this indicates that 2 threads of a single core can (and generally do) have different frequencies. Is that possible?

I would also like to know whether /proc/cpuinfo gather the information about the frequencies of all cores/threads exactly at the same time (same cpu cycle) or whether there is a slight delay that may differ according to each core/thread. This may explain why 2 threads of a single core have different frequencies, in case it's impossible that 2 threads of a same real core have different frequencies.

Thank you.
bhamadicharef
Posts: 31
Joined: Fri Nov 25, 2016 10:14 am
Location: Singapore

Re: Hardware questions about cores and threads and /proc/cpu

Post by bhamadicharef »

You can read more about such issue at

https://unix.stackexchange.com/question ... nt-numbers

there are a lot of things going on that we/you may not be aware, and also these tools may not report the metric that you expect/assume to be ...
Brahim HAMADICHAREF
Singapore
Isaac
Posts: 265
Joined: Sat Feb 22, 2014 8:37 pm

Re: Hardware questions about cores and threads and /proc/cpu

Post by Isaac »

bhamadicharef wrote:You can read more about such issue at

https://unix.stackexchange.com/question ... nt-numbers

there are a lot of things going on that we/you may not be aware, and also these tools may not report the metric that you expect/assume to be ...
First of all, thanks for the reply.
I think the link doesn't answer the question but shows that there is some stuff going on like you say.
I have checked the Linux kernel code at github about /proc/cpuinfo to see what it returns, I've eye-glanced into a few files but that's over my head. I don't know C and I do very little programming.
User avatar
Lasse Hansen
Posts: 27
Joined: Wed May 28, 2008 1:07 pm
Location: Porsgrunn, Norway

Re: Hardware questions about cores and threads and /proc/cpu

Post by Lasse Hansen »

I use i7z_GUI to get the correct frequencies.
IIRC it's installed by sudo apt-get install i7z-gui
Works like a charm for i7-2600K and i7-4790K

Regards, Lasse