Rich Mingin (PLUG) via plug on 12 Dec 2021 17:16:12 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] CPU Scaling


This has actually been the standard for about 10-15 years now. If you check cpu clocks while you are actively loading the CPU, you’ll see much higher clocks. You cannot meaningfully change the minimum speed on recent CPUs. 

If you switch to a performance cpu governor, you will see higher idle cpu speeds, but will likely *lose* peak single thread speeds, as the cpu won’t be idle enough for ‘hot’ cores to boost above the baseline max. In my current desktop, this doesn’t matter much, because AMD’s max boost for my Ryzen 9 is only about 200MHz faster than the baseline, but on my older i7-4790k, this would have kept single core peak down to 4.4GHz instead of 4.9GHz. 

On a recent low power Intel laptop I have, this would hold the 3.6GHz boost speed down to the 1.2GHz official all-core maximum! You notice that right away, even just on the desktop/browsing the web.


On Sun, Dec 12, 2021 at 19:34 Walt Mankowski via plug <plug@lists.phillylinux.org> wrote:
Thanks Wayne,

As long as it's normal then I won't worry about it. This is a desktop
with a cooling system so I'm not too worried it getting too hot. OTOH,
I don't have any pressing need to overclock it, and it sounds like the
defaults use less power when it's idle.

Walt

On Sun, Dec 12, 2021 at 03:26:10PM -0800, Wayne via plug wrote:
>
> I don't know if there is a setting that will 'lock' in the CPU speed. Most of them will vary the speed according to need. You can see what the Max speed of all the cores are currently set to with this:
>
> p=$(nproc --ignore=1); for i in $(seq 0 $p); do cat /sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_freq; done
>
> You can alter the Max speed (to, say, 1.2GHz) with this:
>
> sudo bash -c 'p=$(nproc --ignore=1); for i in $(seq 0 $p); do echo 1200000 > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_freq; done'
>
> I do this to lower temperatures on the laptop. Resist the temptation to set it to anything higher that the Max specified speed for your CPU though. You don't want to turn your computer into a space heater.
>
>
>
> On 12/12/21 2:41 PM, Walt Mankowski via plug wrote:
> > Hi,
> >
> > As usual in December I've been working my way through the awesome Advent of Code <https://adventofcode.com/>problems. (This year we're saving Christmas by riding around in a submarine. Don't ask.)
> >
> > While working on today's problem <https://adventofcode.com/2021/day/12> I noticed that my code ran about twice as fast on my Apple laptop than my Ubuntu desktop, despite the fact that my desktop's CPUs are over 50% faster (3.5 GHz AMD vs 2.3 GHz Intel Core i7). When I looked in |/proc/cpuinfo| I saw that the "cpu MHz" field was only 1400!
> >
> > I did some searches online and discovered this seems to be due to something called "CPU Scaling". I've looked at |/proc/cpuinfo| subsequently and I've also run |cpufreq-info(1)| and the numbers vary quite a bit. I'm guessing the system is dynamically adjusting the CPU speed based on the current system load.
> >
> > I've never noticed this before so I don't know if it's been in effect for a while, or if it's something new in Ubuntu 21.10. I'm not sure yet if I want to keep it or turn it off, but I would like to know more about where it's set and how to tune it. Unfortunately most of the information I've been able to find out about it seems fairly dated and predates Ubuntu's adoption of systemd. Can anyone point me to more up to date information?
> >
> > Thanks.
> >
> > Walt
> >
> >
> > ___________________________________________________________________________
> > Philadelphia Linux Users Group         --        http://www.phillylinux.org
> > Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> > General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
> >
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug