Re: /etc/rc.d/powerd vs. lack of OID dev.cpu.0.freq

From: Andriy Gapon <avg_at_freebsd.org>
Date: Thu, 17 Mar 2011 14:41:35 +0200
on 17/03/2011 13:51 David Wolfskill said the following:
> I run powerd(8) on my laptop, and track both stable/8 and head on it (on
> different slices), daily.
> 
> I am now finally(!) getting around to pointing out that it appears that:
> 
> * /etc/rc.d/powerd tries to make use of sysctl OID dev.cpu.0.freq.
> 
> * That OID exists in stable/8.
> 
> * It does not exist in head, certainly as of r219711.
> 
> * The OID dev.cpu.0.freq_levels does exist (in both).
> 
> From /etc/rc.d/powerd:
> ...
> # $FreeBSD: stable/8/etc/rc.d/powerd 180564 2008-07-16 19:50:29Z dougb $
> ...
> powerd_poststop()
> {
>         sysctl dev.cpu.0.freq=`sysctl -n dev.cpu.0.freq_levels |
>             sed -e 's:/.*::'` > /dev/null
> }
> 
> FreeBSD g1-222.catwhisker.org. 9.0-CURRENT FreeBSD 9.0-CURRENT #169 r219711: Thu Mar 17 04:19:43 PDT 2011     root_at_g1-222.catwhisker.org.:/usr/obj/usr/src/sys/CANARY  i386
> 
> g1-222(9.0-C)[7] sysctl dev.cpu
> dev.cpu.0.%desc: ACPI CPU
> dev.cpu.0.%driver: cpu
> dev.cpu.0.%location: handle=\_PR_.CPU0
> dev.cpu.0.%pnpinfo: _HID=none _UID=0
> dev.cpu.0.%parent: acpi0
> dev.cpu.0.freq_levels: 2801/35000 2450/30625 2134/16607 1867/14531 1600/15000 1400/13125 1200/11250 1000/9375 800/12000 700/10500 600/9000 500/7500 400/6000 300/4500 200/3000 100/1500
> dev.cpu.0.cx_supported: C1/1 C2/1 C3/162
> dev.cpu.0.cx_lowest: C1
> dev.cpu.0.cx_usage: 100.00% 0.00% 0.00% last 309us
> dev.cpu.1.%desc: ACPI CPU
> dev.cpu.1.%driver: cpu
> dev.cpu.1.%location: handle=\_PR_.CPU1
> dev.cpu.1.%pnpinfo: _HID=none _UID=0
> dev.cpu.1.%parent: acpi0
> dev.cpu.1.cx_supported: C1/1 C2/1 C3/162
> dev.cpu.1.cx_lowest: C1
> dev.cpu.1.cx_usage: 100.00% 0.00% 0.00% last 418us
> g1-222(9.0-C)[8] 
> 
> The effect, of course, is that on shutdown, a whine is generated
> to the console, complaining about that lack of dev.cpu.0.freq.
> 
> A quick glance at /usr/src/usr.sbin/powerd/powerd.c
> ($FreeBSD: head/usr.sbin/powerd/powerd.c 211415 2010-08-17 09:11:38Z brucec $)
> also shows it attempting to work with dev.cpu.0.freq.
> 
> Am I managing to overlook something fairly significant here?
> 
> The hardware in question is a Dell Precision M4400.

The OID in question should be provided by cpufreq driver.
You should be looking at dmesg and other kernel-related things to find out what
changed on that level.

-- 
Andriy Gapon
Received on Thu Mar 17 2011 - 11:58:35 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:12 UTC