powerd doesn't decrease CPU frequency in some cases
Rui Paulo
rpaulo at fnop.net
Sun Dec 23 10:07:48 PST 2007
At Sun, 23 Dec 2007 18:01:56 +0200,
Andrey wrote:
>
> Good time of the day.
>
> I've noticed that powerd isn't able to decrease CPU frequency on my
> laptop (HP Compaq 6710b) as soon as frequency gets highest level.
>
> I've pottered a bit in the sources and it seems found the root of the issue.
> So those who are interested in the subject let consider it.
>
> For instance my system reports the following frequency levels:
>
> [silent at beastie][/home/silent]sysctl dev.cpu.0.freq_levels
> dev.cpu.0.freq_levels: 2001/35000 2000/35000 1750/30625 1600/25000
> 1400/21875 1200/16000 1050/14000 900/12000 800/14000 700/12250 600/10500
> 500/8750 400/7000 300/5250
>
> If I try to adjust current frequency to 2000 MHz then I'll get:
> [silent at beastie][/home/silent]sudo sysctl dev.cpu.0.freq=2000
> dev.cpu.0.freq: 300 -> 2001
> Let check:
> [silent at beastie][/home/silent]sysctl dev.cpu.0.freq
> dev.cpu.0.freq: 2001
>
> Thus, as you can see, I have level "2000" which system reports me but
> actually I can't to adjust those one exactly because it silently becomes
> "2001"
>
> Well... If I'm not mistaken powerd calculates the current "CPU idle
> mark" and if it is more then adopted value (by default 90%) then it
> shifts CPU frequency value 1 step down. In my case powerd sticks at
> "2001". It is obvious because when powerd decreases CPU frequency from
> the highest frequency level we'll get the following scenario:
>
> +-----------------------+
> | dev.cpu.0.freq=2001 +--<-+
> +-----------+-----------+ |
> | |
> Y |
> +-----------+-----------+ |
> | "CPU idle" > 90% | |
> +-----------+-----------+ |
> | |
> Y ^
> +-----------+-----------+ ^
> | powerd shifts freq. | ^
> | 1 step down: | |
> | "2001" -> "2000" | |
> +-----------+-----------+ |
> | |
> Y |
> +-----------+-----------+ |
> | actually we have here | |
> | dev.cpu.0.freq == 2001+-->-+
> +-----------------------+
>
>
> According to the things mentioned above I've came to conclusion that in
> my case it is not a good idea to rely on frequency levels reported by
> the system. (Also I saw many sysctl mibs (dev.cpu.0.freq) of many other
> people. And there were "strange" frequency levels like "2000" and
> "2001". Of course I can't state that their systems' behaviors fit my
> case. But still...)
>
> So the simple way out I see is to teach powerd recognize "fake"
> frequency levels. Here I suggest a very simple workaround (and may be
> quite ugly... sorry I'm not sure if it is my cup of tee) which allows me
> to overcome the issue. And I hope it can be useful for smb. else.
>
> Also I'd like to hear opinions of others. May be there exists another
> and simpler way to overcome an issue or even I've missed something or
> not aware of something.
>
>
> Thank you.
>
>
> --
> Sincerely,
> Andrey Kosachenko
I think this is all due to the fact that freq_levels mixes p4tcc, est
and others.
Try adding:
hint.p4tcc.0.disabled=1
hint.acpi_throttle.0.disabled=1
to your /boot/loader.conf
Regards.
--
Rui Paulo
More information about the freebsd-acpi
mailing list