Hi, On 12/1/21, David Christensen wrote: > On 12/1/21 8:58 AM, Lee wrote: >> The short story is that I have an Intel i3 windows 10 desktop with >> cygwin installed and an Intel i5 debian desktop. One of my scripts >> takes about 10 minutes to run on the windows/i3 and 15 minutes on the >> debian/i5! ick >> >> if i do >> $ sudo cpupower frequency-set -g performance >> >> then it takes about 10 minutes to run the script on the i5, **but** >> the cpu frequency never drops down to power-saving mode when the >> machine is idle - eg >> $ sudo cpupower -c all frequency-info | grep 'call to kernel' >> current CPU frequency: 3.99 GHz (asserted by call to kernel) >> current CPU frequency: 3.95 GHz (asserted by call to kernel) >> current CPU frequency: 4.01 GHz (asserted by call to kernel) >> current CPU frequency: 3.91 GHz (asserted by call to kernel) >> current CPU frequency: 3.96 GHz (asserted by call to kernel) >> current CPU frequency: 4.00 GHz (asserted by call to kernel) >> >> and more annoying, setting the frequency governor back to powersave >> doesn't seem to drop the frequency all that much >> >> $ sudo cpupower frequency-set -g powersave >> Setting cpu: 0 >> Setting cpu: 1 >> Setting cpu: 2 >> Setting cpu: 3 >> Setting cpu: 4 >> Setting cpu: 5 >> >> $ sudo cpupower -c all frequency-info | egrep 'call to kernel|The >> governor' >> The governor "powersave" may decide which speed to use >> current CPU frequency: 3.85 GHz (asserted by call to kernel) >> The governor "powersave" may decide which speed to use >> current CPU frequency: 3.58 GHz (asserted by call to kernel) >> The governor "powersave" may decide which speed to use >> current CPU frequency: 4.01 GHz (asserted by call to kernel) >> The governor "powersave" may decide which speed to use >> current CPU frequency: 3.55 GHz (asserted by call to kernel) >> The governor "powersave" may decide which speed to use >> current CPU frequency: 3.66 GHz (asserted by call to kernel) >> The governor "powersave" may decide which speed to use >> current CPU frequency: 3.57 GHz (asserted by call to kernel) >> >> >> How do I get the intel cpu "turbo boost" fully engaged when I'm >> running my script and go back into power save mode when the machine is >> idle? >> >> Thanks >> Lee > > > Which i3?
Intel(R) Core(TM) i3-7100 CPU @ 3.90GHz > i5? Intel(R) Core(TM) i5-9400 CPU @ 2.90GHz There's an 'Operating frequency' graph at https://www.cpu-world.com/Compare/414/Intel_Core_i3_i3-7100_vs_Intel_Core_i5_i5-9400.html comparing the i3 to the i5. It looks like they should be roughly even .. which they seem to be if I do the sudo cpupower frequency-set -g performance before running the script. But then I do sudo cpupower frequency-set -g powersave after the script completes and the machine doesn't drop down to much of a lower frequency when it's idle:( I had to reboot to get the cpu frequency down around 800Mhz again. > Debian? Linux? Debian 11 .. which is linux - yes? > I assume your script is single-threaded (?). You assume correctly :) > I am unfamiliar with 'cpupower'. I use cpufreq-set(1) to set the > governor and the Xfce panel applet "CPU Frequency Monitor" to monitor > the CPU frequency and/or governor. The CPU Frequency Monitor applet seems to work only if you're root :( I added it to my xfce panel and it just says 0.80Ghz -- which matches what I get running cpupower as a lowly user: $ cpupower -c all frequency-info | grep 'call to kernel' current CPU frequency: 800 MHz (asserted by call to kernel) current CPU frequency: 800 MHz (asserted by call to kernel) current CPU frequency: 800 MHz (asserted by call to kernel) current CPU frequency: 800 MHz (asserted by call to kernel) current CPU frequency: 800 MHz (asserted by call to kernel) current CPU frequency: 800 MHz (asserted by call to kernel) lee@spot ~ $ sudo cpupower -c all frequency-info | grep 'call to kernel' [sudo] password for lee: current CPU frequency: 3.50 GHz (asserted by call to kernel) current CPU frequency: 810 MHz (asserted by call to kernel) current CPU frequency: 947 MHz (asserted by call to kernel) current CPU frequency: 3.13 GHz (asserted by call to kernel) current CPU frequency: 1.52 GHz (asserted by call to kernel) current CPU frequency: 992 MHz (asserted by call to kernel) I've got the XFCE panel applet CPU Graph that never shows much of any cpu usage. and the cli program top which will show 99.9% cpu busy when I'm running meld on a pair of 500K line files (which seems very excessive unless meld is multi-threaded). > My compute-bound single-threaded scripts cause the CPU frequency to > increase to maximum on my quad-core i7: > > 2021-12-01 17:48:27 root@tinkywinky ~ > # cat /etc/debian_version ; uname -a ; cpufreq-info -p > 9.13 > Linux tinkywinky 4.9.0-16-amd64 #1 SMP Debian 4.9.272-2 (2021-07-19) > x86_64 GNU/Linux > 800000 3300000 powersave Mine says: # cat /etc/debian_version ; uname -a ; cpufreq-info -p 11.1 Linux spot 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64 GNU/Linux 800000 4100000 powersave > Perhaps your governor is somehow broken? I didn't even know I had a governor until today :) How do I tell if it's broken? > But, the best answer is to rewrite your script as a parallel program. Not the answer I wanted to get :( But if I can't figure out any other way I'm hoping that parallel (http://www.gnu.org/software/parallel/) will be the easy way to parallelize the script. Thanks, Lee