i386/112778: powerd is using sysctl "dev.cpu.0.freq_levels" instead of correct(?) "dev.est.0.freq_settings"

Rechistov Grigory ggg_mail at inbox.ru
Sat May 19 01:40:06 PDT 2007


>Number:         112778
>Category:       i386
>Synopsis:       powerd is using sysctl "dev.cpu.0.freq_levels" instead of correct(?) "dev.est.0.freq_settings"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-i386
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 19 08:40:04 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Rechistov Grigory
>Release:        FreeBSD 6.2-STABLE
>Organization:
>Environment:
FreeBSD ipv82-180.rt.private.mipt.ru 6.2-STABLE FreeBSD 6.2-STABLE #0: Sat May 19 00:53:48 MSD 2007     root at ipv82-180.rt.private.mipt.ru:/usr/obj/usr/src/sys/DELL_v7  i386

>Description:
I have a notebook with a Pentium M processor. With powerd daemon enabled its frequency is varying dynamically in response to average system load. But in this case it often falls the way too low:

$ sysctl dev.cpu.0.freq: 100
$ sysctl dev.cpu.0.freq_levels: 1733/27000 1516/23625 1333/21000 1166/18375 1067/17000 933/14875 800/13000 700/11375 600/9750 500/8125 400/6500 300/4875 200/3250 100/1625

That is, my processor is able to be slowed down to 100 MHz. powerd uses that sysctl to determine what frequencies are availible and then does the throttling. You will agree that 100 MHz is a kind of undesirable option - my music playing is accompanied with scratches and pauses.

Windows XP, running on the same machine, slows down the processor not lower than 800 MHz. I've noticed that

$ sysctl dev.est.0.freq_settings: 1733/27000 1333/21000 1067/17000 800/13000

has the similar list of frequencies, but hasn't the lowest undesirable options. So I changed a bit the source code:

$ diff /usr/src/usr.sbin/powerd/powerd.c powerd.c 
335c335
<       if (sysctlnametomib("dev.cpu.0.freq_levels", levels_mib, &len))
---
>       if (sysctlnametomib("dev.est.0.freq_settings", levels_mib, &len))

So, now the lowest frequency observed is 800 MHz.

I suppose that it is desirable to either use this sysctl either to have an option to explicitly set the lowest frequency to powerd daemon.

Thank you for your work.
>How-To-Repeat:
Use powerd with Pentium M and monitor the frequency.
>Fix:
Replace a line in powerd.c

335c335
<       if (sysctlnametomib("dev.cpu.0.freq_levels", levels_mib, &len))
---
>       if (sysctlnametomib("dev.est.0.freq_settings", levels_mib, &len))

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-i386 mailing list