5

I have an Intel Core i5-2520M CPU in my laptop which has two physical cores and hyperthreads, resulting in four logical cores. When looking at /proc/cpuinfo, I see four different clock speeds:

$ grep MHz /proc/cpuinfo
cpu MHz         : 1124.114
cpu MHz         : 799.865
cpu MHz         : 948.486
cpu MHz         : 1248.168

I do not really know how the hyperthreads are labeled on this machine. From HPC systems I would think that core 1 and 3 correspond to the first physical core.

So how come the clock speeds turn out do be different for all four logical cores? I would think that there can only be one clock speed per physical core.

  • 1
    This is not about Unix/Linx. Hyper-threading means parts of the core are duplicated, there's nothing preventing anyone from duplicating the frequency "generating" parts, and the rest of the cores basically just have a maximum frequency. – Henrik supports the community Aug 30 '17 at 21:02
  • 2
    I'm voting to close this question as off-topic because this question belongs on Superuser. – Satō Katsura Aug 31 '17 at 08:32
  • 1
    Perhaps the frequencies are read one-by-one and not all in one atomic action. – meuh Aug 31 '17 at 13:24
  • Could this instead be migrated to whatever SE site this is more appropriate on? I honestly try to find the best site (because I used lscpu I thought unix.SE was legit), but there is so much overlap that it becomes hard at times. – Martin Ueding Sep 01 '17 at 20:56

1 Answers1

1

Modern CPUs have dynamic frequency scaling. In Intel's case, SpeedStep. What you're seeing there is really probably a better indicator of how your power management is scaling for performance or battery life, by throttling down CPU frequency and/or voltage to fit the needs of the various processes running on those threads.

Change your power management scheme to maximize performance, and then again to maximize battery life, and see how the frequencies change in response.

Tim Kennedy
  • 19,697
  • 1
    I know that the cores change their clock speeds depending on usage. And incidentally, lowering the maximum clock speed will not save battery, on the contrary (race to sleep). I am just wondering why two logical cores of the same physical one show a different speed. Did I overlook that in your answer? – Martin Ueding Sep 01 '17 at 20:58