(automatic) reducing of the CPU speed


  • [this is a request for underclocking, NOT overclocking]


    Why not enable the ondemand governor in the kernel and make a CPU Controll Plugin? Switching cpu frequency up and down "on demand" will have the box running at the lowest frequency for 99% of the (standby) time which will greatly reduce power consumption making the box 'greener' and it will also generate less heat.



    Seems to be working when manually entering the commands below:




    root@dm800 /sys/devices/system/cpu/cpu0/cpufreq # cat
    scaling_available_frequencies
    300000 150000 75000 37500


    root@dm800 /sys/devices/system/cpu/cpu0/cpufreq # echo 37500 >
    scaling_max_freq
    root@dm800 /sys/devices/system/cpu/cpu0/cpufreq # cat scaling_cur_freq
    37500


    root@dm800 ~ # time sh -c 'a=100; while [ $a -gt 0 ]; do a=$(expr $a -
    1); done'
    real 0m 50.07s
    user 0m 9.84s
    sys 0m 30.61s


    root@dm800 /sys/devices/system/cpu/cpu0/cpufreq # echo 300000 >
    scaling_max_freq
    root@dm800 /sys/devices/system/cpu/cpu0/cpufreq # cat scaling_cur_freq
    300000


    root@dm800 ~ # time sh -c 'a=100; while [ $a -gt 0 ]; do a=$(expr $a -
    1); done'
    real 0m 7.06s
    user 0m 1.68s
    sys 0m 5.17s

  • yes, this is a good idea I think, because now with the global warming every kW we can save is a good one.


    And if the CPU supports this Feature why not usign it ?


    Even when the total impact is low if you multiply it with thousands of Dreamboxes in the market it is an effort worth undertaking.


    And together with the Elektro Power Save Plugin for completely shutting down the box in the non-used times this would be a contribution to the environment which DMM could even advertise positively.


    Ciao
    gutemine

    Einmal editiert, zuletzt von Lost in Translation ()

  • Right. So have any of you actually *measured* the power?


    Here are the results: (Power measured at 12.00Vdc, no tuner, no HDD, no TV)


    Base: 495mA
    100% CPU Load: 522 mA



    CPU set to lowest value: (37.5MHz):


    Base: 494mA
    100% CPU Load: 498 mA


    The workload at 100%@37.5Mhz is about 1/8th of the workload of 100%@300Mhz.


    If we interpolate the power used for 12.5% at 300MHZ:


    495 + (522-495)/8 = 498.75 mA


    Which is exactly the same power required as when the cpu is set to 37.5Mhz. Or we can extrapolate the power for 800% cpu load at 37.5 MHz:


    494 + (498 - 494) * 8 = 526mA.


    (Note that I couldn't measure with sub-mA accuracy, so there will be some rounding errors.)


    Bottom line: The idle loop does exactly the same power saving as a hardcoded scaling value. Nothing to gain, here, the box will automatically save power even when not using the cpufreq interface.

  • thanks tmbinc for trying out.


    Off course a CPU not doing much is always cooler then when executing code. Could you test it the other way around - write a small binary that is always executable (just joggling something in memory) and measure the mA when it is running or not - and with both max CPU speeds settings ?


    Or ist this already what you mean with 100% CPU load ?


    Off course the difference will not be that big either, but is it is at least more then 0,1 Watt - why not let the environment benefit from it.


    But you are right - unless the CPU is really busy (and with lower clock speed it is simply longer busy for a longer time = same power consumption in total) there is no real benefit. So the only real benefit would be to lower absolute CPU usage of the code = more optimized code/compilers/libraries,.... ?


    Or even dumber asked - If we use one of the programms which allow you to limit max CPU usage - will this then save Power - maybe some people could live with a temporary slower GUI when they can save the planet ?



    Ciao
    gutemine

    3 Mal editiert, zuletzt von Lost in Translation ()

  • You will not save power if your workset is fixed. If we make the GUI slower, this won't save anything, since the GUI would run a longer time at 100% CPU load than before. The only way to safe power is by limiting what work has to be done, and this is generally a good thing, regardless if we speak about power saving or not.


    So, again: Playing with the cpufreq scaling, on our hardware, does exactly the same thing as inserting random usleep()s into the code. Exactly.

    Einmal editiert, zuletzt von tmbinc ()