4

I have a quad core cpu (core i7 7700) with hyperthreading.

cat /proc/cpuinfo | grep MHz

returns 8 different frequencies, some of which are not repeated (for example I can get a single value of 3914.208 MHz). So it does look like the displayed values are the frequencies of each thread, and these frequencies need not to be equal by pairs. Is this possible? In other words, is it possible that 2 threads of a single core have different frequencies (on IRC I'm told that no and they are saying this behavior is very strange, hence my question here). If not, then what are the displayed frequencies?

Here is a real output of the above command:

cpu MHz     : 799.804
cpu MHz     : 861.987
cpu MHz     : 1178.613
cpu MHz     : 867.260
cpu MHz     : 3418.066
cpu MHz     : 800.024
cpu MHz     : 1302.539
cpu MHz     : 799.804

Edit : With

cat /proc/cpuinfo 

I can see that the MHz corresponds to core 0, 1, 2, 3, 0, 1, 2 and 3 in that order. So, like Hamza Jabbour says, it's the frequency of each thread (also called logical core).

I'd like to know whether it's possible that each thread have its own frequency and whether /proc/cpuinfo gather the data about frequency in more than 1 cpu cycle (which could make the frequency of virtual cores not matching by pairs, I think.)

  • BTW, whenever you grep and get information you don't understand, read the complete text with less or similar. There are so many questions here by people who just grep something and throw away all valuable information that would have explained things. – dirkt Aug 14 '17 at 6:33
  • Fine but this didn't help me to know whether /proc/cpuinfo gathers the information about the threads in 1 cpu cycle. I'm still not sure yet (the current answer doesn't provide any source) that each thread can have a different frequency at a same time (same cpu cycle). I'm still waiting for an answer to that before I can accept the answer. – thermomagnetic condensed boson Aug 14 '17 at 17:50
  • The current frequency is a physical property of the (virtual) core, so it's not "sampled" for a number of "cycles", it's simply read from a processor register, and accurate for the time of reading. (Virtual) core frequency is changed by a certain programs in given intervals, see e.g. here. – dirkt Aug 15 '17 at 4:49
  • Weird that no one wants to answer the question. As additional evidence that a general discussion of CPU scaling is not a sufficient answer, I can get 8 frequencies with 4 physical cores as OP did, but if I boot Windows and look at HWiNFO, I only see 4 core frequencies reported. – Randy Cragun Oct 26 '18 at 9:13
4

This is the frequency of your cores, and you have cores which run with the minimum frequency, and other more stressed which run with higher frequency.

You can have more information and explanation with the lscpu utility.

  • 1
    To add to this, Modern CPU's are constantly scalling/throttling depending on load in real time. There are ways to disable all throttling, but it is not recommended to do so. – crasic Aug 13 '17 at 18:06
  • But I have only 4 real cores. So what do you mean by "cores"? Threads? – thermomagnetic condensed boson Aug 13 '17 at 19:11
  • 1
    yes, you have 4 physical cores, and 8 logical cores, in other word, your hyperthreading enable your core to execute 2 threads similtanously. – Hamza Jabbour Aug 13 '17 at 19:18
  • 1
    in adition, in output of lscpu you will find 2 lines : Core(s) per socket and Thread(s) per core , each thread is a logical core , in your case i think you have : 4 physical core and 2 thread per core <=> 2x4=8 logical core ^^. – Hamza Jabbour Aug 13 '17 at 19:24
  • 1
    @no_choice99 each thread does not have its own frequency, the entire physical core is throttled up/down depending on load, number of threads, affinity, priority, required latency. The frequencies aren't gathered or "measured", but commanded/controlled by the kernel power management, it does not change from cycle to cycle, but will change as threads die or are created. – crasic Aug 13 '17 at 23:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.