Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#6440 - cpufreq : doesn't load values for other processors

Attached to Project: Arch Linux
Opened by alexandre (_alexmyself) - Saturday, 17 February 2007, 13:33 GMT
Last edited by Aaron Griffin (phrakture) - Sunday, 02 December 2007, 21:45 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Kevin Piche (kpiche)
Roman Kyrylych (Romashka)
Architecture All
Severity Medium
Priority Normal
Reported Version 0.7.2 Gimmick
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

hello,

i have cpufreq in rc.conf,daemon
i have P4 m which is hypertreading and so appears as two processors
when i boot cpufreq doesn't set the second processor,
i have to do: cpufreq-set --cpu 1 --governor powersave, for the second to be set like in my /etc/conf.d/cpufreq

i'll try modify cpufreq script but this will be my first step in bash so....so i'm afraid :)
This task depends upon

Closed by  Aaron Griffin (phrakture)
Sunday, 02 December 2007, 21:45 GMT
Reason for closing:  Fixed
Comment by alexandre (_alexmyself) - Thursday, 22 February 2007, 22:54 GMT
i've done it :D






###############################################################################################
###############################################################################################
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

# source application-specific settings
[ -f /etc/conf.d/cpufreq ] && . /etc/conf.d/cpufreq

case "$1" in
start)
stat_busy "Setting cpufreq governing rules"

params=""
if [ -n $governor ]; then
mod="cpufreq_$governor"
modprobe $mod > /dev/null 2>&1
params="-g $governor"
if [ $? -eq 0 ]; then
#################################################
#find how many processors have to be set
#where
cpu_location='/sys/devices/system/cpu/'
#count in a temp file (this help me to correctly handle `ls` output)
`touch temp_cpu_$$`
`ls $cpu_location > temp_cpu_$$`
#list just the directories in $cpu_tab[]
declare -i cpu_index
cpu_index=0
while read temp_cpu_line;
do
[ -d "$cpu_location$temp_cpu_line" ] && cpu_tab[$cpu_index]=$temp_cpu_line && cpu_index+=1
done < temp_cpu_$$
#kill the temp file
rm temp_cpu_$$
#################################################
if [ "$min_freq" != "" ]; then
params="$params -d $min_freq"
fi
if [ "$max_freq" != "" ]; then
params="$params -u $max_freq"
fi
else
stat_busy " Cannot load governor module '$governor'"
stat_fail
exit
fi
fi

if [ "$params" != "" ]; then
#################################################
#set for each cpu in $cpu_tab[]
cpu_index=0
for a_cpu in "${cpu_tab[@]}"
do
`cpufreq-set --cpu $cpu_index $params`
cpu_index+=1
done
#################################################
#cpufreq-set $params
stat_done
else
stat_busy " Invalid configuration in /etc/conf.d/cpufreq"
stat_fail
fi
;;
stop)
# nothing to do
;;
restart)
$0 start
;;
set)
# TODO: make callable... "cpufreq set 800MHz"
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0
###############################################################################################
###############################################################################################
Comment by alexandre (_alexmyself) - Thursday, 22 February 2007, 23:15 GMT Comment by Roman Kyrylych (Romashka) - Wednesday, 28 February 2007, 23:39 GMT
you can also use http://pastebin.archlinux.org/ (just be sure to select long time period).
Comment by Nicolas Doualot (slubman) - Wednesday, 25 July 2007, 07:19 GMT
Another (less intrusive ?) patch for /etc/rc.d/cpuqreq : http://pastebin.archlinux.org/11124
Comment by Nicolas Doualot (slubman) - Wednesday, 25 July 2007, 07:29 GMT
Oops, wrong version posted, the good one is : http://pastebin.archlinux.org/11127 (I apologize)
Comment by Sven Salzwedel (sasv) - Friday, 28 September 2007, 08:18 GMT
Hi,

i've another (simple) version for the cpufreq rc script: http://dump.mookooh.org/cpufreq.diff
Comment by Kevin Piche (kpiche) - Monday, 19 November 2007, 20:14 GMT
People with multiple cpu's please install verison 002-2 and test. Thanks.
Comment by Nicolas Doualot (slubman) - Tuesday, 20 November 2007, 08:29 GMT
Tested on x86_64 by replacing the existing /etc/rc.d/cpufreq with the one on CVS, and works fine AFAIK.

Loading...