Or - also possible, it sets always stop options even if starting. On my system this release behaves weird, sets performance governor but points out to have installed ondemand though: > cat scaling_available_frequencies scaling_available_governors 3166000 2670000 2336000 2003000 ondemand performance > /etc/init.d/cpufrequtils start cpufrequtils | * Running cpufreq-set --governor ondemand ... > cat scaling_cur_freq scaling_governor 3166000 performance Running by Hand: > cpufreq-set --governor ondemand > cat scaling_cur_freq scaling_governor 2003000 ondemand The last is the expected nehaviour, the -dv debug output of initscript also says running "cpufreq-set --governor ondemand" but it is doing something else...
strace -fF when starting, excerpt: 31340 execve("/lib/rc/bin/ebegin", ["ebegin", "Running cpufreq-set --governor o"...], [/* 37 vars */] <unfinished ...> 31341 execve("/usr/bin/cpufreq-set", ["cpufreq-set", "--governor", "performance"], [/* 37 vars */] <unfinished ...> 31341 open("/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor", O_WRONLY) = 3 31341 write(3, "performance"..., 11) = 11
i think the init script is wrong. there are two start functions... i think its a copy and paste error. start() { ebegin "Running cpufreq-set ${START_OPTS}" cpufreq-set ${START_OPTS} eend $? } start() { ebegin "Running cpufreq-set ${START_OPTS}" cpufreq-set ${STOP_OPTS} eend $? }
Created attachment 169266 [details, diff] patch to fix init script
*ARGH* I investigated the init script but did not see the doubled start function and missing stop part ;-) The fix solves this. Weird thing is verbose printing is done with first and execve with cpufreq-set is done with second start function ;-)
Another problem is that this init script only affects the first CPU. Any other CPU is happily ignored by this init script (this is not nice on a dual quad-core machine...) How about something like this? (taken from bug #190997) local cpu n for cpu in /sys/devices/system/cpu/cpu[0-9]*; do n=${cpu##*cpu} cpufreq-set -c ${n} ${START_OPTS} done eend $?
(In reply to comment #5) > Another problem is that this init script only affects the first CPU. Any other > CPU is happily ignored by this init script (this is not nice on a dual > quad-core machine...) you are right. i will attach a changed patch.
Created attachment 169304 [details, diff] multi cpu patch for cpufrequtils-init.d-005
hmm, some systems will set states for all procs regardless. my amd64 4200+ will change both cpus even if no -c is specified. fixed with 005-r1 at any rate http://sources.gentoo.org/sys-power/cpufrequtils/files/cpufrequtils-init.d-005?r1=1.1&r2=1.2
(In reply to comment #8) > hmm, some systems will set states for all procs regardless. you are right. it works on multi core systems for all cores if you change the states of one. apparently because cpus do not support different clockspeeds for the cores of one chip. if you have a multi chip system then you have to change the states of every chip.
The K9 dual-core chips from AMD cannot have different clock speeds for each core but the K10 chips (phenom, barcelona) can have each core set to another frequency independent from the other cores.