On Tue, Apr 25, 2006 at 12:34:29AM -0500, anoop aryal wrote: > On Monday 24 April 2006 13:03, Mattia Dongili wrote: [...] > summry: > the config file seems fine the way it is. i really don't see setting > individual CPU cores to different speeds/governors. in fact, it seems that
Fine, seems the best/easiest action, other more complex may be dealt with in specifically crafted scripts from sysadmins. [...] > i'm putting in the patch i had sent to you earlier with your suggested > changes > for the RETVAL. i think that is exactly what i want. you might want to tweak > the detection of the different CPUs as you mentioned but it also works the > way it is - at least on my system. I'm attaching the script I have here, could you kindly test it (I suppose it is identical to yours)? I also have an "if" statement commented out that checks if the cpu is to be managed alone or together with a different one. Uncomment line 57 and 60 of the script if you want to try it. > btw, KDEs acpi stuff also only sets one core. and since the other defaults to > performance and since the Duo falls under category 2, the result is not what > i want - both cores running at the higher of the two speeds. so i will be > using cpufrequtils with the patch for Duo core. cpufreqd does set a policy on all available cpus ;) Thanks again -- mattia :wq!
#!/bin/sh
### BEGIN INIT INFO
# Required-Start: $local_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: set CPUFreq kernel parameters
# Description: utilities to deal with CPUFreq Linux
# kernel support
### END INIT INFO
#
DESC="CPUFreq Utilities"
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PROGRAM=/usr/bin/cpufreq-set
CPUFREQ_OPTIONS=""
FAIL_MESG=""
# use lsb-base
. /lib/lsb/init-functions
[ -x $PROGRAM ] || exit 0
if [ -f /etc/default/cpufrequtils ] ; then
. /etc/default/cpufrequtils
else
ENABLE="false"
fi
# if not enabled then exit gracefully
[ "$ENABLE" = "true" ] || exit 0
if [ $MAX_SPEED -gt 0 ] ; then
CPUFREQ_OPTIONS="$CPUFREQ_OPTIONS --max $MAX_SPEED"
fi
if [ $MIN_SPEED -gt 0 ] ; then
CPUFREQ_OPTIONS="$CPUFREQ_OPTIONS --min $MIN_SPEED"
fi
if [ -n "$GOVERNOR" ] ; then
#GOVERNOR=$(cpufreq-info -g | sed -ne "s/.*\($GOVERNOR\).*/\1/p")
#if [ -n "$GOVERNOR" ] ; then
CPUFREQ_OPTIONS="$CPUFREQ_OPTIONS --governor $GOVERNOR"
#else
# FAIL_MESG="governor not available"
#fi
fi
CPUS=$(sed -ne 's/^processor\s*: \([0-9]\+\)$/\1/p' /proc/cpuinfo)
RETVAL=0
case "$1" in
start|force-reload|restart|reload)
log_action_begin_msg "$DESC: Setting $GOVERNOR CPUFreq governor"
for cpu in $CPUS ; do
# if [ $(cpufreq-info -a --cpu $cpu) -eq $cpu ] ; then
log_progress_msg "CPU${cpu} "
$PROGRAM $CPUFREQ_OPTIONS 2>&1 > /dev/null || RETVAL=$?
# fi
done
log_action_end_msg $RETVAL "$FAIL_MESG"
;;
stop)
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}"
exit 1
esac
exit 0
signature.asc
Description: Digital signature

