Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] cpufreq cpudyn --> still full cpupower
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
pumbaa
n00b
n00b


Joined: 12 Mar 2004
Posts: 61
Location: 8° 53' E - 47° 48' N

PostPosted: Thu Mar 18, 2004 5:43 pm    Post subject: [solved] cpufreq cpudyn --> still full cpupower Reply with quote

HI there!

I have a problem getting my Speedstepping work. I'm working on an IBM R32, and the latest BIOS installed.

I followed Earthwing's excellent description to set Power Management up. The battery runlevel switching is working but when it comes to the cpufreq, cpudyn part ...

My possible scalingfrequencies are:
Code:
 # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
1600000 1200000


My cpufreqd.conf
Code:
[General]
pidfile=/var/run/cpufreqd.pid
poll_interval=2
pm_type=acpi #(acpi, apm or pmu)
# Uncomment the following line to enable ACPI workaround (see cpufreqd.conf(5))
# acpi_workaround=1
verbosity=4 #(if you want a minimal logging set to 5)
                                                                                                                           
[Profile]
name=ac
minfreq=1200000
maxfreq=1600000
policy=performance
                                                                                                                           
[Profile]
name=battery
minfreq=1200000
maxfreq=1200000
policy=powersave

# AC - ON
[Rule]
name=ac_on
ac=on                    # (on/off)
profile=ac
                                                                                                                           
# AC - Off (Battery)
[Rule]
name=battery_on
ac=off                   # (on/off)
battery_interval=0-100
cpu_interval=0-100
profile=battery


I also run cpudyn ... As far as the throttling is concerned i have
Code:
# cat /proc/acpi/processor/CPU/throttling
state count:             8
active state:            T0
states:
   *T0:                  00%
    T1:                  12%
    T2:                  25%
    T3:                  37%
    T4:                  50%
    T5:                  62%
    T6:                  75%
    T7:                  87%

I didn't change the default /etc/conf.d/cpudyn. Thus, when running on battery (I think)
Code:

THROTTLING_LOW=7          (in /etc/conf.d/cpudyn)

should change the throttling state to T7 ... However it doesn't.

When I unplug AC the nohting changes.
Code:

# cat /proc/cpuinfo

still gives me the max cpufreg, and also the Throttling state doesn't change, and still is T0. The scaling_governor changes ... however in a quite funny way ... sometimes it is correct. sometimes it is "performance" when running on battery and changes to "powersave" when plugging in AC...

Can anybody help me?

---

I tried to emerge speedfreq (I have acpi in my USEflags), but I get a funny error
Code:

 # emerge speedfreq
Calculating dependencies ...done!
>>> emerge (1 of 1) sys-apps/speedfreq-0.7.2 to /
>>> md5 src_uri ;-) speedfreq-0.7.2.tar.gz
>>> Unpacking source...
>>> Unpacking speedfreq-0.7.2.tar.gz to /var/tmp/portage/speedfreq-0.7.2/work
>>> Source unpacked.
make: bk: Command not found
gcc -O3 -pipe -march=pentium4 -mcpu=pentium4 -mfpmath=sse -fomit-frame-pointer -fprefetch-loop-arrays -fmerge-all-constants   -c -o speedfreq.o speedfreq.c
gcc -fpic -O3 -pipe -march=pentium4 -mcpu=pentium4 -mfpmath=sse -fomit-frame-pointer -fprefetch-loop-arrays -fmerge-all-constants -o libspeedfreq.po -c libspeedfreq.c
gcc -O3 -pipe -march=pentium4 -mcpu=pentium4 -mfpmath=sse -fomit-frame-pointer -fprefetch-loop-arrays -fmerge-all-constants   -c -o speedfreqd.o speedfreqd.c
version.c updated
gcc -fpic -O3 -pipe -march=pentium4 -mcpu=pentium4 -mfpmath=sse -fomit-frame-pointer -fprefetch-loop-arrays -fmerge-all-constants -o version.po -c version.c
gcc -o libspeedfreq.so.1 -shared -fpic -Wl,-soname,libspeedfreq.so.1 libspeedfreq.po version.po
ln -sf libspeedfreq.so.1 libspeedfreq.so
gcc -Wl,-rpath,/usr/lib -o speedfreq speedfreq.o -L. -lspeedfreq
gcc -O3 -pipe -march=pentium4 -mcpu=pentium4 -mfpmath=sse -fomit-frame-pointer -fprefetch-loop-arrays -fmerge-all-constants -o _speedfreqmodule.so -I/usr/include/python2.2 -shared -fpic -Wl,-soname,_speedfreqmodule.so python.c libspeedfreq.so
python.c:10:20: Python.h: No such file or directory
python.c:14: error: syntax error before "pysf_methods"
python.c:14: warning: data definition has no type or storage class
python.c:15: error: syntax error before '*' token

... (a lot more of this stuff)

python.c:381: error: (near initialization for `pysf_methods[12]')
python.c:382: warning: data definition has no type or storage class
make: *** [_speedfreqmodule.so] Error 1
make: *** Waiting for unfinished jobs....
 
!!! ERROR: sys-apps/speedfreq-0.7.2 failed.
!!! Function src_compile, Line 33, Exitcode 2
!!! compile of speedfreq failed

... this is the first time I can't emerge smth, so I don't know what to do ...

Thx for your help!
greets


Last edited by pumbaa on Fri Mar 19, 2004 2:42 am; edited 1 time in total
Back to top
View user's profile Send private message
Earthwings
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 7753
Location: Germany

PostPosted: Thu Mar 18, 2004 6:53 pm    Post subject: Reply with quote

Quote:

I followed Earthwing's excellent description to set Power Management up.

Thank you :)

Quote:

Code:

# cat /proc/cpuinfo

still gives me the max cpufreg, and also the Throttling state doesn't change, and still is T0. The scaling_governor changes ... however in a quite funny way ... sometimes it is correct. sometimes it is "performance" when running on battery and changes to "powersave" when plugging in AC...

My /proc/cpuinfo isn't updated right, too. Only the bogomips line changes, while the "CPU mhz" line always reflects the speed the CPU was set to at boot time. I'm guessing this is a kernel bug.

To get the actual speed I'm currently using "x86info -mhz" (emerge x86info and make the changes in kernel config as noted).

I'm going to update the doc today or tomorrow to reflect this, I'll also include some notes on speedfreq.
Back to top
View user's profile Send private message
LostControl
l33t
l33t


Joined: 02 Mar 2004
Posts: 885
Location: La Glane, Suisse

PostPosted: Thu Mar 18, 2004 6:53 pm    Post subject: Reply with quote

For speedfreq :

You have python2.3 installed and if you look, speedfreq try to include headers from /usr/include/python2.2. Just make a symlink from /usr/include/python2.3.

Code:
ln -s /usr/include/python2.2 /usr/include/python2.3


This should solve the compilation problem :D
Back to top
View user's profile Send private message
pumbaa
n00b
n00b


Joined: 12 Mar 2004
Posts: 61
Location: 8° 53' E - 47° 48' N

PostPosted: Thu Mar 18, 2004 7:13 pm    Post subject: Reply with quote

thx ... i hope i'll get speedstep to work ...


Just if someone experiences the same problem emerging speedfreq:
Quote:

Code:

ln -s /usr/include/python2.2 /usr/include/python2.3



should be

Code:

ln -s /usr/include/python2.3 /usr/include/python2.2


change the .2 and .3 ...
Back to top
View user's profile Send private message
pumbaa
n00b
n00b


Joined: 12 Mar 2004
Posts: 61
Location: 8° 53' E - 47° 48' N

PostPosted: Thu Mar 18, 2004 11:31 pm    Post subject: Reply with quote

Sorry Earthwings for not answering to your post ... I didn't see yours, since you postet at the same time as LostControl did (I scrolled down the whole page) ...

Quote:

My /proc/cpuinfo isn't updated right, too. Only the bogomips line changes, while the "CPU mhz" line always reflects the speed the CPU was set to at boot time. I'm guessing this is a kernel bug.


My bogomips don't change either ... but still ... is it possible my cpufreqd works, I just can't see it? ...

I managed to emerge speedfreq ... and I think this is working, the
Code:

# speedfreq -m

changes if I run some programs ... Can I rely on that ? 8O

Quote:

I'm going to update the doc today or tomorrow to reflect this, I'll also include some notes on speedfreq.


This would be great ... Again, thx a lot for the doc ...

PS: Yet an idea for "solving" the extra
Quote:

Note: One thing is missing: Gentoo will boot into runlevel default regardless of AC or battery plugged in. One way to get round this is to add a "softlevel=battery" boot parameter, but there has to be a more automatic way. I'll have a deeper look into this and update this document appropriatly.


PPS: Anyone having a P4m: I have only 2 speedsteps, the 1600Mhz and the 1200Mhz. gkrellm shows temperature 60° more or less all the time, going up and down 5° when idle or at full cpupower ... is this normal?


Last edited by pumbaa on Fri Mar 19, 2004 12:41 am; edited 1 time in total
Back to top
View user's profile Send private message
Earthwings
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 7753
Location: Germany

PostPosted: Fri Mar 19, 2004 12:07 am    Post subject: Reply with quote

I just finished the (quite big) update. Please try the x86info tool (there's something about it in the guide, too) and see what it reports - it doesn't rely on what the kernel thinks, but estimates the speed on it's own. If it reports 1600 MHz, there'll be something wrong.
Back to top
View user's profile Send private message
pumbaa
n00b
n00b


Joined: 12 Mar 2004
Posts: 61
Location: 8° 53' E - 47° 48' N

PostPosted: Fri Mar 19, 2004 12:37 am    Post subject: Reply with quote

I'm not so sure anymore wether speedfreq is really doing a good job ... The "speedfreq -m" only changed the first time i ran it ... after that, never again ... although set to dynamic

I emerged x86info ... I allways get a 1199.88 Mhz estimate ... independent of the speedfreq options ...

So I'm still trying to get this working ... I can't sleep otherwise :twisted:
Back to top
View user's profile Send private message
pumbaa
n00b
n00b


Joined: 12 Mar 2004
Posts: 61
Location: 8° 53' E - 47° 48' N

PostPosted: Fri Mar 19, 2004 1:40 am    Post subject: Reply with quote

Ok. After reading through the new version of the Power Management Guide I now have what I want!

cpufreqd and cpudynd work ...

I don't know what is it with speedfreq ... maybe it's already to late ...
Quote:

I emerged x86info ... I allways get a 1199.88 Mhz estimate ... independent of the speedfreq options ...

I should have seen that ... when speedfreq is running, you can't change the scaling_setspeed ... therefore
Code:

echo -n 1000000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed

didn't work ... :oops:

Remark:
I added cpudyn to default runlevel ... because I also want cpudyn to put my HD to sleep ...
Code:
# rc-update add cpudyn default

Maybe this also will reduce my CPU-Temperature a little.

---

I'm really tired ... so forgive me for not trying on my own ... how can I define different times for HDsleeping depending on the runlevel?
Code:

local CPUDYN_OPTS="-t 60 -h /dev/hda"     #runlevel battery
local CPUDYN_OPTS="-t 600 -h /dev/hda"    #runlevel default


gn8
Back to top
View user's profile Send private message
Earthwings
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 7753
Location: Germany

PostPosted: Fri Mar 19, 2004 8:39 am    Post subject: Reply with quote

You can query /var/lib/init.d/softlevel for the current runlevel and set CPUDYN_OPTS depending on this.
Back to top
View user's profile Send private message
pumbaa
n00b
n00b


Joined: 12 Mar 2004
Posts: 61
Location: 8° 53' E - 47° 48' N

PostPosted: Fri Mar 19, 2004 12:31 pm    Post subject: Reply with quote

Thx ! I hope my script does what I want ...

I have another question regarding the runlevel changing.
As I worte above I added cpudyn to default runlevel, but cpufreq not (both are in runlevel battery). Now when unplugging AC, it switches to battery runlevel, however if I type rc-status I get cpufreq [off].
If I add cpufreq also to default runlevel it is always [started] ...

Nevertheless it seems to work, because x86info tells me constantly 1200Mhz in battery mode, and when on AC it dynamically changes between 1200 and 1600. Maybe the cpufreq is obsolete ... :roll:

@ Earthwings
PS: There is a little typo in the Manual.
Quote:

Code listing 3.2

emerge ... cpudynd ...


shoud be
Code:

emerge cpudyn
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum