Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Speedstep on Centrino
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
dredd
n00b
n00b


Joined: 27 Nov 2003
Posts: 63
Location: Switzerland

PostPosted: Thu Dec 04, 2003 7:02 pm    Post subject: Speedstep on Centrino Reply with quote

Hi

I own a hp nx7000. currently I'm running mm sources 2.6.0-test10.
I have been reading many threads here about speedstepping on centrino notebooks, but none of them helped me to understand how to get it working on my notebook. I have activated the cpu scaling in the kernel options, but now I don't know, do I need another program or daemon to make it work? I've read something about cpufreqd, but it doesnt seem to do anything when I run it....

also, like ine some threads described, I do not find "Pentium M enhanced speedstep" in the kernel options.....

hope somebody can clear things up a bit...
Back to top
View user's profile Send private message
dulljeff
n00b
n00b


Joined: 29 Oct 2003
Posts: 65

PostPosted: Thu Dec 04, 2003 8:45 pm    Post subject: Re: Speedstep on Centrino Reply with quote

dredd wrote:
I own a hp nx7000

Me too :)

I got SpeedStep running, not perfectly and I don't know if it is the only way to get there, but the cpu runs with 600MHz and I can switch it manually.

dredd wrote:
also, like ine some threads described, I do not find "Pentium M enhanced speedstep" in the kernel options.....

There is no such option, just enable "SpeedStep", the info says btw that this is the option to choose if you got a centrino cpu.
I would advise you to compile all the acpi stuff into the kernel, not as modules.

You have to create a directory "/sys" as root for things to work.
After booting the new kernel, type
Code:
echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Your cpu should run then with 600MHz only and the fun shouldn't be heard at all.

If you want to get more speed again, type
Code:
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor


That's how I'm doing speedstepping at the moment, until I get to know a better way.
Back to top
View user's profile Send private message
thundersteele
Apprentice
Apprentice


Joined: 30 Aug 2003
Posts: 219

PostPosted: Thu Dec 04, 2003 9:35 pm    Post subject: Reply with quote

Code:
ACCEPT_KEYWORDS="~x86" emerge speedfreq

Then have a look at the man page. I personally like the dynamic policy, cpu is held in 600 MHz mode when Idle, but will increase frequency when it is needed.

Kernel:
Code:
Power management options (ACPI, APM)  --->
   CPU Frequency scaling  --->
      Intel Enhanced SpeedStep (NEW)
Back to top
View user's profile Send private message
dredd
n00b
n00b


Joined: 27 Nov 2003
Posts: 63
Location: Switzerland

PostPosted: Thu Dec 04, 2003 10:34 pm    Post subject: Reply with quote

thundersteele wrote:
Code:
ACCEPT_KEYWORDS="~x86" emerge speedfreq

Then have a look at the man page. I personally like the dynamic policy, cpu is held in 600 MHz mode when Idle, but will increase frequency when it is needed.

Kernel:
Code:
Power management options (ACPI, APM)  --->
   CPU Frequency scaling  --->
      Intel Enhanced SpeedStep (NEW)


thanks to both of you for your answers... it sounds good with the dynamic policy.... but if I want to start the speedfreqd I get:

Need sysfs mounted on /sys, and kernel configured with cpufreq driver

so... do I need to add an entry to fstab to mount sysfs? and do I need to be running the cpufreqd as well?

phil
Back to top
View user's profile Send private message
dredd
n00b
n00b


Joined: 27 Nov 2003
Posts: 63
Location: Switzerland

PostPosted: Thu Dec 04, 2003 11:04 pm    Post subject: Reply with quote

ok.. I had to reboot.. now I got the tree in the /sys folder.... but still when trying to run

Code:

/usr/sbin/speedfreqd -p dynamic


I now get....

Code:

/usr/sbin/speedfreqd: can't open /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed: No such file or directory


so still there's missing something

hope you can help...
Back to top
View user's profile Send private message
tuxlover
Apprentice
Apprentice


Joined: 21 Oct 2003
Posts: 297
Location: weltweit

PostPosted: Fri Dec 05, 2003 12:28 am    Post subject: Reply with quote

I guess there's still something missing from your kernel...

Does your kernel .config's CPU Freq scaling section look like this (this is mine, and it works, on test11):
Code:

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
# CONFIG_CPU_FREQ_PROC_INTF is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_24_API=y
CONFIG_CPU_FREQ_TABLE=y

#
# CPUFreq processor drivers
#
CONFIG_X86_ACPI_CPUFREQ=y
CONFIG_X86_ACPI_CPUFREQ_PROC_INTF=y
# CONFIG_X86_POWERNOW_K6 is not set
# CONFIG_X86_POWERNOW_K7 is not set
# CONFIG_X86_POWERNOW_K8 is not set
# CONFIG_X86_GX_SUSPMOD is not set
CONFIG_X86_SPEEDSTEP_CENTRINO=y
# CONFIG_X86_SPEEDSTEP_ICH is not set
# CONFIG_X86_SPEEDSTEP_SMI is not set
# CONFIG_X86_P4_CLOCKMOD is not set
# CONFIG_X86_LONGRUN is not set
# CONFIG_X86_LONGHAUL is not set
Back to top
View user's profile Send private message
optilude
Apprentice
Apprentice


Joined: 29 May 2002
Posts: 248
Location: England

PostPosted: Fri Dec 05, 2003 12:54 am    Post subject: Reply with quote

You'll need all the ACPI stuff + Intel Enhanced SpeedStep + Userspace policy governor compiled into the kernel or as modules. I always use modules wherever possible, and make sure I load the ACPI modules at startup.

emerge speedfreq with ACCEPT_KEYWORDS="~x86" and do "rc-update speedfreq add boot".

Have a look at this thread: https://forums.gentoo.org/viewtopic.php?t=106835&highlight=

It will give you a set of scripts to manage power profiles. The defaults there should work for you if you use speedfreq to control your CPU speed, although the LCD brightness is dependent on ASUS ACPI extensions.

Martin
_________________
--
"Life is both a major and a minor key" -- Travis
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7731
Location: Underworld

PostPosted: Fri Dec 05, 2003 3:25 pm    Post subject: Reply with quote

I am using cpudyn with cpufreq patches to get most of my battery, and it seems to work fairly well.
_________________
"I'm just very selective about the reality I choose to accept." -- Calvin
Back to top
View user's profile Send private message
dredd
n00b
n00b


Joined: 27 Nov 2003
Posts: 63
Location: Switzerland

PostPosted: Fri Dec 05, 2003 5:21 pm    Post subject: Reply with quote

tuxlover wrote:
I guess there's still something missing from your kernel...

Does your kernel .config's CPU Freq scaling section look like this (this is mine, and it works, on test11):
Code:


#
# CPUFreq processor drivers
#
CONFIG_X86_ACPI_CPUFREQ=y
CONFIG_X86_ACPI_CPUFREQ_PROC_INTF=y


Hi

I was missing those two settings.. gonna recompile the kernel and see if it works.... will let you know

phil
Back to top
View user's profile Send private message
dredd
n00b
n00b


Joined: 27 Nov 2003
Posts: 63
Location: Switzerland

PostPosted: Fri Dec 05, 2003 5:23 pm    Post subject: Reply with quote

optilude wrote:
I always use modules wherever possible, and make sure I load the ACPI modules at startup.




well, don't you think as it is a notebook I always gonna use the ACPI features, so I can directly compile them into the kernel? or do you see a big advantage of running them as modules?

phil
Back to top
View user's profile Send private message
dredd
n00b
n00b


Joined: 27 Nov 2003
Posts: 63
Location: Switzerland

PostPosted: Fri Dec 05, 2003 5:50 pm    Post subject: Reply with quote

ok guys.. seem to be getting closer... after using the newly compiled kernel, I could use the speedfreq command... but I don't think it had any effect... so here's my question:

where can I see the speed at which the cpu currently is running? just entering speedfreq tells me actual policy... but I would like to see the actual cpu speed to be sure....

(I still don't have the 'performance' file in /proc/acpi/processor/CPU0/)

ah yeah, why do I have to run speedfreq at boot and not the daemon speedfreqd?

phil
Back to top
View user's profile Send private message
optilude
Apprentice
Apprentice


Joined: 29 May 2002
Posts: 248
Location: England

PostPosted: Fri Dec 05, 2003 7:59 pm    Post subject: Reply with quote

The /etc/init.d/speedfreq script starts the speedfreqd daemon. The speedfreq command doesn't work unless speedfreqd is running.

I always modularise my kernel as much as humanly possible. It (usually) reduces boot times, and gives me a lot more control about what goes into the kernel and when. It probably doesn't make much difference in this case, though.

"speedfreq -c" tells you the current speed of the CPU. If you use gnome or XFCE4 or another compliant DE/WM, have a look at gdesklets.gnomedesktop.org for my SpeedfreqMon and SpeedfreqTemp gdesklets, which will give you a pretty display of how fast your CPU is running.

Martin
_________________
--
"Life is both a major and a minor key" -- Travis
Back to top
View user's profile Send private message
dredd
n00b
n00b


Joined: 27 Nov 2003
Posts: 63
Location: Switzerland

PostPosted: Fri Dec 05, 2003 8:27 pm    Post subject: Reply with quote

hi

thanks again for your help.. now i got it finally working..... so finally the fan stays off if nothings happening :)

besides the speedfreqd I also have the cpufreqd running, is this correct?

can I use the policies and rules from the /etc/cpufreqd.conf somehow... seems to be pretty good, seems to me like cpufreqd can see if ac is on or off and choosing the according profile....

for me, dynamic is actually best, though on battery (no ac) i sill like being able to choose between performance or powersave myself too....

thanks
phil

ps: do you kow about standy or suspende modes on nx7000?

ps2: how about auto shutoff LCD or HD?
Back to top
View user's profile Send private message
dredd
n00b
n00b


Joined: 27 Nov 2003
Posts: 63
Location: Switzerland

PostPosted: Fri Dec 05, 2003 8:28 pm    Post subject: Reply with quote

hi

thanks again for your help.. now i got it finally working..... so finally the fan stays off if nothings happening :)

besides the speedfreqd I also have the cpufreqd running, is this correct?

can I use the policies and rules from the /etc/cpufreqd.conf somehow... seems to be pretty good, seems to me like cpufreqd can see if ac is on or off and choosing the according profile....

for me, dynamic is actually best, though on battery (no ac) i sill like being able to choose between performance or powersave myself too....

do you know if 600 MHZ is the absolute min frequency of a pentium-m 1500?

thanks
phil

ps: do you kow about standy or suspende modes on nx7000?

ps2: how about auto shutoff LCD or HD?
Back to top
View user's profile Send private message
dulljeff
n00b
n00b


Joined: 29 Oct 2003
Posts: 65

PostPosted: Fri Dec 05, 2003 9:19 pm    Post subject: Reply with quote

600 MHz is definitely not the lowest frequency. Windows slows down the cpu to 240MHz when idle.

I was also wondering how to get the speed lower than 600MHz.

And I'm interested in the suspend and auto-off questions (or better answers) as well.
Back to top
View user's profile Send private message
dulljeff
n00b
n00b


Joined: 29 Oct 2003
Posts: 65

PostPosted: Fri Dec 05, 2003 10:51 pm    Post subject: Reply with quote

As i just figured out you can set the frequency to 240MHz fixed, but that is not the right way - setting your cpu speed manually.

Does anyone know how to get set the min frequency of the daemon?
Back to top
View user's profile Send private message
tuxlover
Apprentice
Apprentice


Joined: 21 Oct 2003
Posts: 297
Location: weltweit

PostPosted: Fri Dec 05, 2003 11:17 pm    Post subject: Reply with quote

dulljeff wrote:
600 MHz is definitely not the lowest frequency. Windows slows down the cpu to 240MHz when idle.


Ok... then why does intel's centrino datasheet only list powersaving modes from 600MHz up? (go to page 22 ff to see the frequency table).

Note that I didn't read anything in this paper really, so if I totally misunderstood how the pentium m works, tell me :)
Back to top
View user's profile Send private message
tuxlover
Apprentice
Apprentice


Joined: 21 Oct 2003
Posts: 297
Location: weltweit

PostPosted: Fri Dec 05, 2003 11:18 pm    Post subject: Reply with quote

dulljeff wrote:
As i just figured out you can set the frequency to 240MHz fixed

as you just figured that out... please tell us how :) no matter what intel says

(sorry to come up with two posts in two minutes I guess I didn't reload the page for an hour or so)
Back to top
View user's profile Send private message
dulljeff
n00b
n00b


Joined: 29 Oct 2003
Posts: 65

PostPosted: Fri Dec 05, 2003 11:31 pm    Post subject: Reply with quote

Thats easy, its described in speedfreq itself:

Code:
Usage: speedfreq [-cmqsDV] [-p policy]
        -c      get info about CPU
        -m      monitor daemon for policy and CPU speed changes
        -p P    set policy to P
        -q      tell server to quit
        -s      get current status
        -D      print debug messages
        -V      version information
 
Available policies:
        powersave       maximise power savings
        performance     maximise performance
        dynamic         adjust speed according to CPU load (default)
        NNN             set CPU to a fixed speed of NNN MHz


So you gotta type
Code:
speedfreq -p 240


I don't know why Intel's datasheet tells us this. I only opened the system properties dialog in Windows and was quite often told about a cpu frequency of ~239MHz.
Back to top
View user's profile Send private message
tuxlover
Apprentice
Apprentice


Joined: 21 Oct 2003
Posts: 297
Location: weltweit

PostPosted: Sat Dec 06, 2003 1:58 am    Post subject: Reply with quote

dulljeff wrote:
So you gotta type
Code:
speedfreq -p 240

I had used cpufreq(d) up to now, so I hadn't even seen that.

But I figure that it doesn't work quite right. Some tests show this:
I made a little c program which basically goes n times through a loop (n being a large number), then stops. I made a couple of "benchmarks":
Code:
speedfreq -p 240
time ./finite

real    0m12.564s
user    0m11.989s
sys     0m0.034s

speedfreq -p 300

time ./finite

real    0m12.571s
user    0m12.001s
sys     0m0.041s

speedfreq -p 600

time ./finite

real    0m12.618s
user    0m11.998s
sys     0m0.042s

speedfreq -p 700

time ./finite

real    0m9.354s
user    0m9.062s
sys     0m0.021s

speedfreq -p 800

time ./finite

real    0m9.350s
user    0m9.022s
sys     0m0.020s

speedfreq -p 900

time ./finite

real    0m7.445s
user    0m7.169s
sys     0m0.027s

speedfreq -p 1000

time ./finite

real    0m7.442s
user    0m7.201s
sys     0m0.020s

speedfreq -p 1100

time ./finite

real    0m6.144s
user    0m6.018s
sys     0m0.019s

speedfreq -p 1200

time ./finite

real    0m6.147s
user    0m5.983s
sys     0m0.013s

speedfreq -p 1300

time ./finite

real    0m5.675s
user    0m5.560s
sys     0m0.011s


So speedfreq isn't working quite right. It also reports the wrong cpu frequency, namely the one it was told to set, when invoked with the -c option:
Code:
speedfreq -p 1
speedfreq -c
CPU speed: min 600MHz, max 1300MHZ, current 1MHz; 97.62% idle

Yeah, right :) And of course, X is still running wonderfully at 1 MHz...

Oh, and here goes the finite program in case you want to try it:
Code:
int main(int argc, char **argv) {

  long i = 0;

  for( ; i < 1000000000; i++ )
          ;
 
  return 0;
}


[edit]Btw, I emailed the speedfreq author about this.[/edit]
Back to top
View user's profile Send private message
dulljeff
n00b
n00b


Joined: 29 Oct 2003
Posts: 65

PostPosted: Sat Dec 06, 2003 10:15 am    Post subject: Reply with quote

Sorry, but I don't the point of your argumentation. It the runtime of the c program goes down proportionally with the cpu speed getting higher, speedfreq seems to work correctly, doesn't it?

But of course, youre right about the 1MHz-killer-machine :wink:
That cannot be possible.
Back to top
View user's profile Send private message
tuxlover
Apprentice
Apprentice


Joined: 21 Oct 2003
Posts: 297
Location: weltweit

PostPosted: Sat Dec 06, 2003 5:52 pm    Post subject: Reply with quote

dulljeff wrote:
It the runtime of the c program goes down proportionally with the cpu speed getting higher, speedfreq seems to work correctly, doesn't it?

Oh well, yes... I didn't say that speedfreq doesn't work in general. It simply doesn't really set some of the speeds it seems to...

If you look at the runtimes of 600 MHz and below, they are all the same, which suggests that the cpu really never runs below 600 MHz, even though speedfreq seems to be able to set it to a value lower than 600.

Also, if you set the cpu freq to 700, it will actually run at 800 (same runtime of c program). The same goes for 900 and 1100 (it rounds up the speed).
Back to top
View user's profile Send private message
hulk2nd
Guru
Guru


Joined: 25 Mar 2003
Posts: 512
Location: Freiburg, Germany

PostPosted: Sat Dec 06, 2003 9:59 pm    Post subject: Reply with quote

have a look at /sys/devices/system/cpu/cpu0/cpufreq/. for example if you cat scaling_setspeed then you'll see the actual frequency your cpu is running atm.
greets,
hulk
Back to top
View user's profile Send private message
thundersteele
Apprentice
Apprentice


Joined: 30 Aug 2003
Posts: 219

PostPosted: Sat Dec 06, 2003 11:37 pm    Post subject: Reply with quote

Code:
cat /proc/cpuinfo

also gives cpu speed
Back to top
View user's profile Send private message
tuxlover
Apprentice
Apprentice


Joined: 21 Oct 2003
Posts: 297
Location: weltweit

PostPosted: Sun Dec 07, 2003 12:53 am    Post subject: Reply with quote

hulk2nd wrote:
have a look at /sys/devices/system/cpu/cpu0/cpufreq/. for example if you cat scaling_setspeed then you'll see the actual frequency your cpu is running atm.

this relies on cpufreq detecting the right cpu speed.
thundersteele wrote:
cat /proc/cpuinfo

also gives cpu speed

True but this again relies on cpufreq (the kernel) to detect the right frequency. Both ways could be as wrong as speedfreq in my opinion.

I'm just saying this to defend my method from above :) But basically, you are right.
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
Goto page 1, 2  Next
Page 1 of 2

 
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