Wie setze ich nach Restart CPU Governor auf "ondemand"?

vickoxy

Active member
Themenstarter
Registriert
28 Apr. 2010
Beiträge
1.691
Hi,
also, ich habe gemerkt, dass nach jedem Restart mein Ubuntu 10.04 64bit startet mit
CPU Einstellung. Ich muss manuell auf ondemand setzen, obwohl sollte schon default so sein.

Mein /etc/init.d/ondemand zeigt:

Code:
#! /bin/sh
### BEGIN INIT INFO
# Provides:          ondemand
# Required-Start:    $remote_fs $all
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:
# Short-Description: Set the CPU Frequency Scaling governor to "ondemand"
### END INIT INFO


PATH=/sbin:/usr/sbin:/bin:/usr/bin

. /lib/init/vars.sh
. /lib/lsb/init-functions

case "$1" in
    start)
    	start-stop-daemon --start --background --exec /etc/init.d/ondemand -- background
        ;;
    background)
	sleep 60 # probably enough time for desktop login

	for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
	do
		[ -f $CPUFREQ ] || continue
		echo -n ondemand > $CPUFREQ
	done
	;;
    restart|reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
    stop)
        ;;
    *)
        echo "Usage: $0 start|stop" >&2
        exit 3
        ;;
esac

Weiß jemand, wo der Fehler ist?
 
Du mußt nach der Anmeldung einfach etwas mehr Geduld haben, ondemand wird erst mit 60s Verzögerung aktiv -> steht in dem von dir gezeigten Skript: "sleep 60".
 
Für ein EDIT vielleicht zu lang. So, eine Lösung habe ich hier gefunden:
Meine
Code:
/etc/cpufreqd.conf
:

Code:
# this is a comment
# see CPUFREQD.CONF(5) manpage for a complete reference
#
# Note: ondemand/conservative Profiles are disabled because
#       they are not available on many platforms.

[General]
pidfile=/var/run/cpufreqd.pid
poll_interval=2
verbosity=4
#enable_remote=1
#remote_group=root
[/General]

#[acpi]
#acpid_socket=/var/run/acpid.socket
#[/acpi]

#[nforce2_atxp1]
#vcore_path=/some/path
#vcore_default=1500
#[/nforce2_atxp1]

#[sensors_plugin]
#sensors_conf=/some/file
#[/sensors_plugin]

[Profile]
name=On Demand High
minfreq=40%
maxfreq=100%
policy=ondemand
[/Profile]

[Profile]
name=On Demand Low
minfreq=20%
maxfreq=80%
policy=ondemand
[/Profile]

[Profile]
name=Performance High
minfreq=100%
maxfreq=100%
policy=performance
#exec_post=echo 8 > /proc/acpi/sony/brightness
[/Profile]

[Profile]
name=Performance Low
minfreq=80%
maxfreq=80%
policy=performance
[/Profile]

[Profile]
name=Powersave High
minfreq=60%
maxfreq=60%
policy=powersave
[/Profile]

[Profile]
name=Powersave Low
minfreq=40%
maxfreq=40%
policy=powersave
[/Profile]

#[Profile]
#name=Conservative High
#minfreq=33%
#maxfreq=100%
#policy=conservative
#[/Profile]
#
#[Profile]
#name=Conservative Low
#minfreq=0%
#maxfreq=66%
#policy=conservative
#[/Profile]

##
# Basic states
##
# when AC use performance mode
[Rule]
name=AC Rule
ac=on                    # (on/off)
profile=On Demand
[/Rule]
 
# stay in performance mode for the first minutes
[Rule]
name=AC Off - High Power
ac=off                   # (on/off)
battery_interval=70-100
#exec_post=echo 5 > /proc/acpi/sony/brightness
profile=On Demand
[/Rule]

# conservative mode when not AC
[Rule]
name=AC Off - Medium Battery
ac=off                   # (on/off)
battery_interval=30-70
#exec_post=echo 3 > /proc/acpi/sony/brightness
[B]profile=On Demand[/B]
[/Rule]

# conservative mode when not AC
[Rule]
name=AC Off - Low Battery
ac=off                   # (on/off)
battery_interval=0-30
#exec_post=echo 3 > /proc/acpi/sony/brightness
[B]profile=On Demand[/B]
[/Rule]

##
# Special Rules
##
# CPU Too hot!
[Rule]
name=CPU Too Hot
acpi_temperature=55-100
cpu_interval=50-100
profile=Performance Low
[/Rule]

# use performance mode if I'm watching a movie
# I don't care for batteries! 
# But don't heat too much.
[Rule]
name=Movie Watcher
programs=xine,mplayer,gmplayer
battery_interval=0-100
acpi_temperature=0-60
cpu_interval=0-100
profile=Performance High
[/Rule]

Aber, wie gut diese Lösung ist? Ich meine-jetzt nach restart habe ich sofort on-demand, aber ich bin kein Linux Experte um zu schätzen wie gut diese Lösung ist...
 
Du mußt nach der Anmeldung einfach etwas mehr Geduld haben, ondemand wird erst mit 60s Verzögerung aktiv -> steht in dem von dir gezeigten Skript: "sleep 60".

Das habe ich gewusst. Leider-funktioniert nicht-ich habe es mehrmals getestet, aber steht dauernd in performance...
 
Meines Wissens ist es sowohl am Netz als auch am Akku optimal, den Prozesser im On-demand-Betrieb laufen zu lassen. PowerTop z.B. empfielt auch, auf On-demand zu stellen, selbst wenn man manuell auf die niedrigste Taktstufe schaltet.

Da On-demand den Prozesser hochtaktet, wenn die Leistung gebraucht wird, sollte Deiner Lösung m.E. nichts entgegenstehen.

Andererseits ist es sicherlich auch durchdacht, dass die Ubuntu-Entwickler dieses Skript geschrieben haben.
 
Mach mal
Code:
sudo update-rc.d ondemand start 99 2 3 4 5 .
(den Punkt am Ende beim Cut&Paste nicht vergessen ...)
 
Code:
Adding system startup for /etc/init.d/ondemand ...
   /etc/rc2.d/S99ondemand -> ../init.d/ondemand
   /etc/rc3.d/S99ondemand -> ../init.d/ondemand
   /etc/rc4.d/S99ondemand -> ../init.d/ondemand
   /etc/rc5.d/S99ondemand -> ../init.d/ondemand

Und jetzt? Soll ich CPUFREQD.CONF löschen um zu testen ob was geändert ist?
 
  • ok1.de
  • ok2.de
  • thinkstore24.de
  • Preiswerte-IT - Gebrauchte Lenovo Notebooks kaufen

Werbung

Zurück
Oben