Keresés

Aktív témák

  • domerator

    veterán

    válasz domerator #15764 üzenetére

    Ez egy nem tudom milyen kernelben (nem Defy kernel!) levő smartass governor ismertetése az xda-ról asszem. Eddig jutottam a magyar fordítással (nem azért, mert nem megy az angol, hanem mert értelmezni kellene.)

    --------------------------------------------------------------------

    SmartassV2 (informal description and comparison with the first smartass)

    SmartassV2 is a governor (controls the frequency of the CPU at each give moment) which like the first smartass is generally based on the implementation of interactive with some major changes and the addition of a built in sleep profile (behaves a bit differently when screen is off vs. on).

    The smartassV2 improves the very naive scheme which the first smartass had: The first smartass (with the values I set for the hero), would cap the max frequency at 352Mhz for sleep and when screen is on, would do the opposite and keep the frequency at 518Mhz or above. For sleep this was very effective but a bit crude and unclean, and there could be some cases where you would need processing power even when screen is off (something is updating and music is playing and etc.). For screen on, smartass1 was too quick to jump to the max available frequency and again would never go below the 518Mhz, so in a nutshell its was using "too high" frequencies.

    SmartassV2, introduce (internally) an "ideal" frequency which is the frequency we are "aiming" for, in some sense. The way I see it is that the "ideal" frequency is a hint to the governor what is a good balance between performance and battery life. Now when screen is on, I set (on the hero) the ideal frequency to 518Mhz which will ensure nice responsiveness but limit unnecessary use of higher frequencies when they are not needed. When screen is off, I set the ideal frequency to 352Mhz (0 will disable the screen state tracking all together). From my testing this will "convince" the governor to spend most of the its time during sleep at the lowest available frequencies. Note, that both during sleep and when awake the entire frequency range (as defined by the "user" - i.e. selected with SetCPU) is used by smartassV2. For example, when the CPU is loaded heavily, the highest available frequency will be used regardless if screen is on or off.

    Smartass sysfs usage:

    The original smartass patch that I found did not have a working sysfs interface, there were slight issues with it, so I decided to fix it, since it’s very useful to have. All smartass control files are located at /sys/devices/system/cpu/cpu0/cpufreq/smartass.

    The following is a list of each file, and it’s description:

    down_rate_us
    The minimum amount of time to spend at a frequency before we can ramp down, default is 45ms.

    up_min_freq
    When ramping up frequency with no idle cycles jump to at least this frequency. Zero disables. Set a very high value to jump to policy max freqeuncy.
    Felpörgéskor késedelem nélkül erre a frekire fog ugrani. 0 érték kiiktatja ezt a funkciót. Ha a policy maximális freki értékét akarod elérni, állíts be kellően magas frekvenciát.

    awake_min_freq
    When awake_min_freq>0 the frequency when not suspended will not go below this frequency. Set awake_min_freq=0 to disable this behavior.
    Ébrenlétben a beállított frekvencia alá nem megy a cpu. Ha értéke 0 akkor ez a funkció nem működik.

    sleep_max_freq
    When sleep_max_freq>0 the frequency when suspended will be capped by this frequency. Also will wake up at max frequency of policy to minimize wakeup issues.
    Ha ez az érték nagyobb, mint 0, akkor erre az értékre fog állni a cpu alvó módban. Ébredéskor a policy maximális frekijére ugrik, hogy az ébredéskor ne legyenek késések.

    sleep_wakeup_freq
    The frequency to set when waking up from sleep. When sleep_max_freq=0 this will have no effect.
    Az a frekvencia, amire ébredéskor ugrik a cpu. Ha a sleep_max_freq értéke 0, akkor ez sem működik.

    sample_rate_jiffies
    Sampling rate, I highly recommend to leave it at 2.

    ramp_up_step
    Freqeuncy delta when ramping up. Zero disables causes to always jump straight to max frequency.
    Frekvencia lépésköz a felpörgéskor. Ha értéke 0, akkor közvetlenül a max frekvenciára ugrik.

    max_ramp_down
    Max freqeuncy delta when ramping down. zero disables.

    max_cpu_load
    CPU freq will be increased if measured load > max_cpu_load.
    A cpu százalékos terhelése, amely fölött a policy növeli a frekvenciát.

    min_cpu_load
    CPU freq will be decreased if measured load < min_cpu_load.
    A cpu százalékos terhelése, amely alatt a policy csökkenti a frekvenciát.

    Current smartass defaults set in my kernels:
    down_rate_us=20
    max_cpu_load=75
    max_ramp_down=38400
    min_cpu_load=50
    ramp_up_step=38400
    sample_rate_jiffies=2
    sleep_max=245760
    sleep_wakeup_freq=998400
    up_min_freq=9999999

    To read the current values (max_cpu_load as an example):
    cat /sys/devices/system/cpu/cpu0/cpufreq/smartass/max_cpu_load

    To set the current values (max_cpu_load as an example):
    echo "80" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/max_cpu_load
    Controlling the current cpufreq policy, i.e., How to Over/Under clock without SetCPU:

    There are also control files associated with the CPU frequency, cpufreq, driver located at /sys/devices/system/cpu/cpu0/cpufreq.

    The following is a list of the important files and their descriptions:

    scaling_available_frequencies (Read-Only)
    Lists all available frequencies that the processor is programmed to handle. This doesn’t mean that all will work, just that it’s possible to tell the processor to attempt to use them.

    scaling_available_governors (Read-Only)
    Lists all available governors available for usage.

    scaling_cur_freq (Read-Only)
    Lists the current operating frequency of the processor.

    scaling_governor (Read-Write)
    Gets/Sets the currently used governor.

    scaling_max_freq
    Gets/Sets the maximum allowed frequency for the current policy, refer to scaling_available_governors for valid frequencies.

    scaling_min_freq
    Gets/Sets the minimum allowed frequency for the current policy, refer to scaling_available_governors for valid frequencies.

    To read the currently available frequencies:
    cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

    To set the current governor to smartass:
    echo "smartass" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

    To change the maximum frequency:
    echo "1536000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

    - up_rate_us:
    The minimum amount of time to spend at a frequency before we can ramp up.
    Default value:
    Code:
    echo "24000" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/up_rate_us

    - down_rate_us:
    The minimum amount of time to spend at a frequency before we can ramp down. Default value:
    Code:
    echo "49000" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/down_rate_us

    - up_min_freq:
    When ramping up frequency with no idle cycles jump to at least this frequency.
    Zero disables. Set a very high value to jump to policy max freqeuncy.
    Code:
    echo "0" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/up_min_freq

    - sleep_max_freq:
    When sleep_max_freq>0 the frequency when suspended will be capped by this frequency. Also will wake up at max frequency of policy to minimize wakeup issues.
    Set sleep_max_freq=0 to disable this behavior.
    Default value:
    Code:
    echo "122880" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/sleep_max_freq

    - sleep_wakeup_freq:
    The frequency to set when waking up from sleep.
    When sleep_max_freq=0 this will have no effect.
    Default value:
    Code:
    echo "600000" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/sleep_wakeup_freq

    - awake_min_freq: When awake_min_freq>0 the frequency when not suspended will not go below this frequency.
    Set awake_min_freq=0 to disable this behavior.
    Default value:
    Code:
    echo "0" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/awake_min_freq

    - sample_rate_jiffies:
    Sampling rate, I highly recommend to leave it at 2.

    - ramp_up_step:
    Freqeuncy delta when ramping up.
    zero disables and causes to always jump straight to max frequency.
    Default value:
    Code:
    echo "220000" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/ramp_up_step

    - ramp_down_step:
    Freqeuncy delta when ramping down.
    zero disables and will calculate ramp down according to load heuristic.
    Default value:
    Code:
    echo "160000" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/ramp_down_step

    - max_cpu_load:
    CPU freq will be increased if measured load > max_cpu_load.
    Default value:
    Code:
    echo "75" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/max_cpu_load

    - min_cpu_load: CPU freq will be decreased if measured load < min_cpu_load.
    Default value:
    Code:
    echo "25" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/min_cpu_load

    - sleep_rate_us: Sleep rate when screen is off
    Code:
    echo "500000" > /sys/devices/system/cpu/cpu0/cpufreq/smarta

    [ Szerkesztve ]

    Reggae ‘till I die ... iPhone 13 mini, MacBook Air M1, Homepod (sztereó)

  • domerator

    veterán

    válasz domerator #15764 üzenetére

    Na mára feladtam a smartass-szal való kínlódást... valahogy nem az igazi.

    Egyszerűen nem tudom, hogy aki ezt elkészítette bele a miui-ba, vagy egyáltalán, az miért nem adott ki hozzá valamiféle tutorialt... ráadásul többféle változat is van belőle, no meg a belinkelt angol leírásban vannak olyanok is, hogy xy dolgot ha nullára állítasz, akkor kiiktatódik... na a defyben vagy 2 dolgot nem is lehet nullára állítani... :W :W

    Nem tudom, honnan lehetne ezeket az infókat megszerezni, a francba... :O

    Visszaálltam ondemandra.

    Reggae ‘till I die ... iPhone 13 mini, MacBook Air M1, Homepod (sztereó)

Aktív témák