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

Re: using intel i5 freqency governors



On 12/1/21 9:08 PM, Lee wrote:
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)


That is expected. Performance runs the CPU at maximum frequency all of the time.



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)


That is a problem.



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?


I leave my governor at the default value (powersave) all of the time.


Which i3?

Intel(R) Core(TM) i3-7100 CPU @ 3.90GHz


That should run a single-threaded program at 3.90 GHz.


  i5?

Intel(R) Core(TM) i5-9400 CPU @ 2.90GHz


That should run a single-threaded program at 4.10 GHz.


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.


Sites like that typically use benchmarks that use all available cores. I looked at the Intel site to get the single-threaded numbers, above:

https://ark.intel.com/content/www/us/en/ark/compare.html?productIds=134898,97455


  Debian?  Linux?

  Debian 11 .. which is linux - yes?


Linux is the kernel.  'uname -a' (below) gives that information.


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 :(


It is unwise to run a graphical desktop as root.


CPU Frequency Monitor works correctly with my normal account on Debian 9 and 10. I have not tried 11.


I added it to my xfce panel and it just says 0.80Ghz --


Right click on it, choose Properties, and set Display CPU to "max". Then run some CPU intensive programs and watch if the frequency displayed changes.



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).


That means meld is using one core 99.9%. A parallel program should show the program on several lines with CPU utilization anywhere between 0 and 100%.


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


Okay. Facts produced by console sessions make for better posts, questions, and answers.


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?


By understanding what the CPU frequency governor it is supposed to do, and then devising and running tests to verify that you understand it and it works.


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


Please tell us about your script so that we can make relevant comments. What language? What task does it accomplish? How is it designed? If you can boil it down and post the code, that would be best.


David


Reply to: