Reply
Thread Tools
automagic68's Avatar
Posts: 415 | Thanked: 161 times | Joined on Apr 2010 @ San Francisco, CA
#161
What are your guys thoughs on skipping frequencies? I've read about skipping 550mhz being tossed around. I was also thinking of skipping 805 since my max is set at 850? Doesn't 850 seem way more effiecent since they both use close to the same voltage?
 
tonism's Avatar
Posts: 20 | Thanked: 37 times | Joined on May 2010 @ Estonia
#162
Originally Posted by automagic68 View Post
What are your guys thoughs on skipping frequencies? I've read about skipping 550mhz being tossed around. I was also thinking of skipping 805 since my max is set at 850? Doesn't 850 seem way more effiecent since they both use close to the same voltage?
Along with that voltage increase I've made 700, 900 and 1150 MHz setups for starving conf as well that skip some speeds:

http://talk.maemo.org/showpost.php?p...&postcount=101

Last edited by tonism; 2010-05-15 at 18:41.
 

The Following User Says Thank You to tonism For This Useful Post:
Posts: 284 | Thanked: 320 times | Joined on May 2010 @ Peterborough, UK
#163
The powersave_bias setting (mentioned here and here) seems to have vastly improved my battery life - I thought I would flag them up in this thread as they got rather lost in the noise of the overclocking thread. I do however use samping_rate of 25 rather than 20 and up_threshold of 350000.

It needs changes to the kernel-config script itself to enable, however these are not complex, I can post them if anyone is interested?

Many thanks to bigswed for all of this as it was he who really alerted me to the setting; I also think the full range of frequencies (such as 550, 805 etc) are useful, even required, when using powersave as the ondemand governor switches between frequencies to average out at the required % reduction.

Last edited by Tigerite; 2010-05-15 at 18:52. Reason: Clarification
 

The Following 4 Users Say Thank You to Tigerite For This Useful Post:
Posts: 24 | Thanked: 4 times | Joined on Mar 2010
#164
Originally Posted by Tigerite View Post
The powersave_bias setting (mentioned here and here) seems to have vastly improved my battery life - I thought I would flag them up in this thread as they got rather lost in the noise of the overclocking thread. I do however use samping_rate of 25 rather than 20 and up_threshold of 350000.

It needs changes to the kernel-config script itself to enable, however these are not complex, I can post them if anyone is interested?

Many thanks to bigswed for all of this as it was he who really alerted me to the setting; I also think the full range of frequencies (such as 550, 805 etc) are useful, even required, when using powersave as the ondemand governor switches between frequencies to average out at the required % reduction.
I would be interested to know these things. My N900 doesn't handle extremely low voltage at all (No starving or deprived for me). Can you also explain what changing the sampling_rate and up_threshold does?

Thanks
__________________
cb00
http://www.freemaemohelp.com
 
Posts: 284 | Thanked: 320 times | Joined on May 2010 @ Peterborough, UK
#165
Originally Posted by cb00 View Post
Can you also explain what changing the sampling_rate and up_threshold does?
Sure, as far as I understand it sampling_rate is the number of milliseconds between which the ondemand governor checks the current frequency, and either ups it to the max if the CPU utilization is above the % set in up_threshold, or begins to lower it if not. So for instance up_threshold of 95 means that if utilization is above 95%, then the CPU is set to the maximum in your config; if below this value and the CPU is above the minimum in your config, it will begin to lower it one step at a time.

For a more thorough explanation, which probably makes a lot more sense, click here

Here's my version of kernel-config; I have only added powersave_bias, the rest is exactly as titan's copy. You'll need to replace the one in /usr/sbin with it; I've also pasted my version of starving beneath to show how it works (very straightforward).

Code:
#!/bin/sh
# kernel configuration script for power user kernel
# (c) Copyright 2010 by Thomas Tanner <maemo@tannerlab.com>
# licensed under GPLv3
# version 0.2 (7. May 2010)

if test $# -eq 0; then
    echo "$0 command [options]"
    echo "commands:"
    echo "  show        - show current settings"
    echo "  load <file> - load settings from file"
    echo "  save <file> - save settings to file (abs. path or filename in /home/user/.kernel)"
    echo "  default [<file>] - set file or the current settings as default settings"
    echo "  limits min max - set the frequency limits ('-' keeps the current setting)"
    echo "  lock freq [volt] [dsp] - lock CPU at frequency with specific settings"
    echo "  unlock       - unlock CPU frequency"
    echo "filenames: absolute path or filename in search path or none=defaults"
    echo "search path: .,/home/user/.kernel,/usr/share/kernel-power-settings/"
    exit 1
fi
if test "`id -u`" -ne 0; then
    sudo $0 $* # run as root
    exit $?
fi

cfr=/sys/devices/system/cpu/cpu0/cpufreq
cfd=$cfr/ondemand
pwr=/sys/power

echo ondemand > $cfr/scaling_governor
if test -f $cfd/avoid_frequencies -a -f $pwr/vdd1_opps_vsel -a -f $pwr/dsp_opps_rate; then :
else
    echo This kernel version `uname -r` is not supported
    echo Please make sure that kernel-power is installed and running.
    echo If you have just installed the kernel, you need to shutdown and boot to activate it.
    echo To reinstall the power user kernel run:
    echo \'apt-get install --reinstall kernel-power kernel-power-flasher\'
    exit 1
fi

allfreq=
for f in `cat $cfr/scaling_available_frequencies`; do
    allfreq="$f $allfreq"
done
vsel=`cat $pwr/vdd1_opps_vsel` 
rate=`cat $pwr/dsp_opps_rate` 

cmd=$1
test "$cmd" = setdefault && cmd=default # old name
case " show load save default limits lock unlock " in
*" $cmd "*) ;;
*)  echo "invalid command $cmd";  exit 1 ;;
esac
arg=
shift
if test "$cmd" = unlock; then
    echo 'unlocking frequency. reset to defaults'
    cmd=loaddef
fi
if test "$cmd" = default && test $# -eq 0; then
    echo 'saving current settings as defaults'
    arg=/etc/default/kernel-power
    cmd=savedef
fi

popvsel() { curvsel=$1; shift; vsel="$*"; }
poprate() { currate=$1; shift; rate="$*"; }

case $cmd in
show|save|savedef)
    minfreq=$((`cat $cfr/scaling_min_freq`/1000))
    maxfreq=$((`cat $cfr/scaling_max_freq`/1000))
    test $maxfreq = 599 && maxfreq=600
    avoid=`cat $cfd/avoid_frequencies`
    freqs=
    for f in 0 $allfreq; do
        popvsel $vsel
        poprate $rate
        case " $avoid " in *" $f "*) ;;
        *) freqs="$freqs$((f/1000)):$curvsel,$currate " ;;
        esac
    done
    if test $cmd = show; then
        echo "current kernel configuration:"
        echo "current frequency:" $((`cat $cfr/scaling_cur_freq`/1000))
        echo -n "supported frequencies: "
        for f in $allfreq; do echo -n "$((f/1000)) "; done
        echo
        echo "min. frequency:" $minfreq
        echo "max. frequency:" $maxfreq
        echo -n "avoid frequencies: "
        for f in $avoid; do echo -n "$((f/1000)) "; done
        echo
        echo "active frequencies: $freqs"
        echo "SmartReflex" "VDD1=`cat $pwr/sr_vdd1_autocomp`, VDD2=`cat $pwr/sr_vdd2_autocomp`"
        echo -n "ondemand: ignore nice load=" `cat $cfd/ignore_nice_load` 
        echo -n ", powersave bias=" `cat $cfd/powersave_bias`
        echo -n ", up threshold=" `cat $cfd/up_threshold`
        echo ", sampling rate=" `cat $cfd/sampling_rate`
    else
        test $cmd = save && arg=$1
	if test -z "$arg"; then
	    echo "filename argument is mssing"
	    exit 1
	fi
        if test `basename $arg` = $arg; then
	    u=/home/user/.kernel
	    arg=$u/$arg
	    if test ! -d $u; then
		mkdir -p $u
		chown user.users $u
	    fi
	    touch $arg
	    chown user.users $arg
	fi
        rm -f $arg
        echo "saving to $arg"
        echo "# kernel configuration file generated by $0" > $arg
        echo "MINFREQ=$minfreq" >> $arg
        echo "MAXFREQ=$maxfreq" >> $arg
        echo "FREQS=\"$freqs\"" >> $arg
        echo "SMARTREFLEX_VDD1=`cat $pwr/sr_vdd1_autocomp`" >> $arg
        echo "SMARTREFLEX_VDD2=`cat $pwr/sr_vdd2_autocomp`" >> $arg
        echo "IGNORE_NICE_LOAD=`cat $cfd/ignore_nice_load`" >> $arg
        echo "POWERSAVE_BIAS=`cat $cfd/powersave_bias`" >> $arg
        echo "UP_THRESHOLD=`cat $cfd/up_threshold`" >> $arg
        echo "SAMPLING_RATE=`cat $cfd/sampling_rate`" >> $arg
    fi
    ;;
load|loaddef)
    test $cmd = loaddef || arg=$1
    if test -z "$arg"; then
        arg=/etc/default/kernel-power
        test -f $arg || arg=/usr/share/kernel-power-settings/default
    fi
    if test `basename $arg` = $arg; then # not absolute
        for p in . /home/user/.kernel /usr/share/kernel-power-settings; do
            test -f $p/$arg && arg=$p/$arg && break
        done
    fi
    if test ! -f "$arg"; then
        echo "file not found $arg"
        exit 1
    fi
    echo "loading $arg"
    source $arg
    if test -n "$VDD1_OPPS_VSEL" -o -n "$DSP_OPPS_RATE"; then
        echo "warning: old configuration format detected. please save in the new format."
        if test -n "$MAX_FREQ"; then
            test $MAX_FREQ = 600000 && MAX_FREQ=599000
            echo $MAX_FREQ > $cfr/scaling_max_freq
        fi
        test -n "$MIN_FREQ" && echo $MIN_FREQ > $cfr/scaling_min_freq
        test -n "$MAX_FREQ" && echo $MAX_FREQ > $cfr/scaling_max_freq
        test -n "$VDD1_OPPS_VSEL" && echo $VDD1_OPPS_VSEL > $pwr/vdd1_opps_vsel
        test -n "$DSP_OPPS_RATE" && echo $DSP_OPPS_RATE > $pwr/dsp_opps_rate
        test -n "$SMARTREFLEX_VDD1" && echo $SMARTREFLEX_VDD1 > $pwr/sr_vdd1_autocomp
        test -n "$SMARTREFLEX_VDD2" && echo $SMARTREFLEX_VDD2 > $pwr/sr_vdd2_autocomp
        test -n "$IGNORE_NICE_LOAD" && echo $IGNORE_NICE_LOAD > $cfd/ignore_nice_load
        test -n "$POWERSAVE_BIAS" && echo $POWERSAVE_BIAS > $cfd/powersave_bias
        test -n "$UP_THRESHOLD" && echo $UP_THRESHOLD > $cfd/up_threshold
        test -n "$SAMPLING_RATE" && echo $SAMPLING_RATE > $cfd/sampling_rate
        exit 1
    fi
    active=
    minfreq=
    maxfreq=
    for f in $FREQS; do
        freq=`echo $f | cut -d: -f1`
        f=`echo $f | cut -d: -f2`
        volt=`echo $f | cut -d, -f1`
        dsp=`echo $f | cut -d, -f2`
        if test ! $freq = 0; then
            test -z "$minfreq" -o "$freq" -lt "$minfreq" && minfreq=$freq
            test -z "$maxfreq" -o "$freq" -gt "$maxfreq" && maxfreq=$freq
            freq=$((freq*1000))
            case " $allfreq " in *" $freq "*) ;;
            *)  echo warning: $freq not supported; continue ;;
            esac
            active="$active $freq"
        fi
        test -z "$volt" && test -z "$dsp" && continue
        tvsel=
        trate=
        for fr in 0 $allfreq; do
            if test $fr = $freq; then
                popvsel $vsel
                poprate $rate
                test -z "$volt" && volt=$curvsel
                test -z "$dsp" && dsp=$currate
                tvsel="$tvsel $volt $vsel"
                trate="$trate $dsp $rate"
                break
            fi
            popvsel $vsel
            tvsel="$tvsel $curvsel"
            poprate $rate
            trate="$trate $currate"
        done
        vsel=$tvsel
        rate=$trate
    done
    test -n "$MINFREQ" && minfreq=$MINFREQ
    test -n "$MAXFREQ" && maxfreq=$MAXFREQ
    test "$minfreq" -gt 100000 && minfreq=$((minfreq/1000))
    test "$maxfreq" -gt 100000 && maxfreq=$((maxfreq/1000))
    avoid=
    for f in $allfreq; do
        if test "$f" -lt $((minfreq*1000)); then
            avoid="$avoid $f"
            continue
        fi
        case " $active " in *" $f "*) ;;
        *) avoid="$avoid $f" ;;
        esac
    done
    echo $avoid > $cfd/avoid_frequencies
    echo $vsel > $pwr/vdd1_opps_vsel
    echo $rate > $pwr/dsp_opps_rate
    test $maxfreq = 600 && maxfreq=599
    echo $((maxfreq*1000)) > $cfr/scaling_max_freq
    echo $((minfreq*1000)) > $cfr/scaling_min_freq
    echo $((maxfreq*1000)) > $cfr/scaling_max_freq
    test -n "$SMARTREFLEX_VDD1" && echo $SMARTREFLEX_VDD1 > $pwr/sr_vdd1_autocomp
    test -n "$SMARTREFLEX_VDD2" && echo $SMARTREFLEX_VDD2 > $pwr/sr_vdd2_autocomp
    test -n "$IGNORE_NICE_LOAD" && echo $IGNORE_NICE_LOAD > $cfd/ignore_nice_load
    test -n "$POWERSAVE_BIAS" && echo $POWERSAVE_BIAS > $cfd/powersave_bias
    test -n "$UP_THRESHOLD" && echo $UP_THRESHOLD > $cfd/up_threshold
    test -n "$SAMPLING_RATE" && echo $SAMPLING_RATE > $cfd/sampling_rate
    echo "successfully loaded."
    ;;
default)
    arg=$1
    if test -z "$arg"; then
        echo "filename missing"
        exit 1
    fi
    if test `basename $arg` = $arg; then # not absolute
        for p in . /home/user/.kernel /usr/share/kernel-power-settings; do
            test -f $p/$arg && arg=$p/$arg && break
        done
    fi
    def=/etc/default/kernel-power
    rm -f $def
    case $arg in 
    /usr/share/kernel-power-settings/*) ln -s $arg $def ;;
    *) cp $arg $def ;;
    esac
    echo "defaults set to $arg"
    ;;
limits)
    minfreq=$1
    maxfreq=$2
    if test "x$minfreq" = x -o "x$maxfreq" = x; then
        echo "frequency limit arguments missing"
        exit 1
    fi
    test "x$minfreq" = "x-" && minfreq=$((`cat $cfr/scaling_min_freq`/1000))
    test "x$maxfreq" = "x-" && maxfreq=$((`cat $cfr/scaling_max_freq`/1000))
    limits="$minfreq,$maxfreq"
    minfreq=$((minfreq*1000))
    maxfreq=$((maxfreq*1000))
    case " $allfreq " in *" $minfreq "*) ;;
    *) echo "invalid lower limit $1"; exit 1; ;;
    esac
    case " $allfreq " in *" $maxfreq "*) ;;
    *) echo "invalid upper limit $2"; exit 1; ;;
    esac
    if test $minfreq -gt $maxfreq; then
	echo "minimum must not be greater than maximum: $limits"
	exit 1
    fi
    test $maxfreq = 600000 && maxfreq=599000
    echo $maxfreq > $cfr/scaling_max_freq
    echo $minfreq > $cfr/scaling_min_freq
    echo $maxfreq > $cfr/scaling_max_freq
    echo "the limits were set to [$limits]"
    ;;
lock)
    arg=$1
    altfreq=
    for f in $allfreq; do
        test "$f" = "$arg" && continue
        altfreq=$f
        break
    done
    vsel=
    dsp=
    freq=$((arg*1000))
    ifreq=
    i=1
    avoid=
    for f in $allfreq; do
        i=$((i+1))
        if test $f = $freq; then
            ifreq=$i
            break
        fi
        avoid="$avoid $f"
    done
    if test -z "ifreq"; then
        echo invalid frequency $freq
        exit 1
    fi
    echo userspace > $cfr/scaling_governor 
    echo $altfreq > $cfr/scaling_setspeed # temporarily set alternative frequencies
    volt=$2
    if test -n "$volt"; then
        i=0
        vsel=
        for v in `cat $pwr/vdd1_opps_vsel`; do
            i=$((i+1))
            test $i = $ifreq && v=$volt
            vsel="$vsel $v"
        done
        echo $vsel > $pwr/vdd1_opps_vsel
    fi
    dsp=$3
    if test -n "$dsp"; then
        i=0
        dsp=
        for r in `cat $pwr/dsp_opps_rate`; do
            i=$((i+1))
            test $i = $ifreq && r=$dsp
            dsp="$dsp $r"
        done
        echo $dsp > $pwr/dsp_opps_rate
    fi
    echo locking frequency $freq
    echo ondemand > $cfr/scaling_governor 
    echo $avoid > $cfd/avoid_frequencies # avoid all other freqs
    maxfreq=$freq
    test $maxfreq = 600000 && maxfreq=599000
    # min after max? kernel docs are wrong?
    echo $maxfreq > $cfr/scaling_max_freq
    echo $freq > $cfr/scaling_min_freq
    echo $maxfreq > $cfr/scaling_max_freq
    ;;
esac
exit 0
Code:
# tonism starving undervolt configuration for titan kernel
# minimum frequency to use
MINFREQ=125
# maximum frequency to use
MAXFREQ=1000
# list of frequency configurations: each "frequency:volt,dsprate"
FREQS="0:18,90 125:22,90 250:28,180 500:29,360 550:32,400 600:34,430 700:41,430 750:42,430 805:45,430 850:46,500 900:49,500 950:52,500 1000:55,500 1100:63,520 1150:69,520"
UP_THRESHOLD=95
SAMPLING_RATE=350000
SMARTREFLEX_VDD1=0
SMARTREFLEX_VDD2=0
IGNORE_NICE_LOAD=1
POWERSAVE_BIAS=25

Last edited by Tigerite; 2010-05-15 at 21:23. Reason: Added link, instructions, plus config file
 

The Following 3 Users Say Thank You to Tigerite For This Useful Post:
Posts: 6 | Thanked: 0 times | Joined on Nov 2009
#166
Curious to see more of this power_bias setting...

Some of the configs Ive tried so far..

Deprived 250-1000 - Phone would become unstable and unresponsive.

Deprived 250-750 - Seemed stable until play media/videos. Fast forwarding or rewinding video would cause it to crash.

Starving configs seemed to work for me nicely..

Starving 250-850 - Very stable tested it for two days and was able to do everything I normally do. Battery Life seemed dramatically improved.

Starving 250-900 - Currently testing now seems stable so far. Going to try it for a couple more days to see if theres any hiccups.

Last edited by elstupidos; 2010-05-18 at 02:21.
 
Posts: 53 | Thanked: 8 times | Joined on Apr 2010 @ Switzerland
#167
This is how my drained settings shows compared titan and rest.

PHP Code:
     default ULV     XLV     ideal  starving deprived drained
0    0
,9750  0,9125  0,8500         0,8750   0,8500   -
125  0,9750  0,9125  0,8500         0,8750   0,8500   -
250  1,0750  0,9125  0,9750         0,9500   0,9000   0,8750
500  1
,2000  1,0125  1,0125  0,9750 0,9625   0,9500   0,9375
550  1
,2750  1,0750  1,0750  1,0125 1,0000   0,9875   -
600  1,3500  1,0750  1,0750  1,0750 1,0250   1,0125   0,9750
700  1
,3500  1,1625  1,1625  1,1625 1,1125   1,0750   1,0500
750  1
,3500  1,1625  1,1625  1,1625 1,1250   1,1000   1,0875
805  1
,3500  1,2000  1,2000  1,2000 1,1625   1,1375   1,1250
850  1
,3500  1,2000  1,2000  1,2000 1,1750   1,1750   1,1625
900  1
,3500  1,2750  1,2750  1,2750 1,2125   1,2000   1,2000
950  1
,3500  1,2750  1,2750  1,2750 1,2375   1,2375   1,2375
1000 1
,3500  1,3500  1,3500  1,3500 1,2875   1,2750   1,2750
1100 1
,5000  1,5000  1,5000  1,5000 1,3875   -        -
1150 1,5000  1,5000  1,5000  1,5000 1,4625   -        - 
I am using it at 250-1000MHz settings stable, any other frequencies is avoided and having 24° temperature in idle

Last edited by Jokah; 2010-06-15 at 01:24.
 

The Following User Says Thank You to Jokah For This Useful Post:
Posts: 209 | Thanked: 44 times | Joined on Jan 2010 @ Austria
#168
Jokah, can you please post the code (config) for your drained settings so that I can copy/paste it in a file. Thanks.
 
Posts: 53 | Thanked: 8 times | Joined on Apr 2010 @ Switzerland
#169
Originally Posted by Mr. Incredible View Post
Jokah, can you please post the code (config) for your drained settings so that I can copy/paste it in a file. Thanks.
Here's my config.

# kernel configuration file generated by /usr/sbin/kernel-config
MINFREQ=250
MAXFREQ=1000
FREQS="0:20,90 250:22,180 500:27,360 600:30,430 700:36,430 750:39,430 805:42,430 850:45,500 900:48,500 950:51,500 1000:54,500 1100:62,520 "
SMARTREFLEX_VDD1=0
SMARTREFLEX_VDD2=0
GOVERNOR=ondemand
IGNORE_NICE_LOAD=0
UP_THRESHOLD=60
SAMPLING_RATE=150000
POWERSAVE_BIAS=0

EDIT: i tuned a few settings

Last edited by Jokah; 2010-06-15 at 06:59.
 

The Following User Says Thank You to Jokah For This Useful Post:
Posts: 5,795 | Thanked: 3,151 times | Joined on Feb 2007 @ Agoura Hills Calif
#170
Comment:

All these "how low can you go?" settings remind me of the reason I am not too enthusiastic about them. Someone who seemed to know what he was talking about was asked if too low a power setting could result in file corruption, and he said yes.

What is bothersome about file corruption is it might not be immediately obvious, so its origin might not be clear. I am running the starving settings, but I'm not going lower than that, at least for now.
 
Reply


 
Forum Jump


All times are GMT. The time now is 00:27.