From owner-freebsd-current@FreeBSD.ORG Thu Mar 17 12:58:35 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 911EA106566C for ; Thu, 17 Mar 2011 12:58:35 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 58D7D8FC12 for ; Thu, 17 Mar 2011 12:58:31 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA25052; Thu, 17 Mar 2011 14:41:35 +0200 (EET) (envelope-from avg@freebsd.org) Message-ID: <4D82017F.1080502@freebsd.org> Date: Thu, 17 Mar 2011 14:41:35 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110309 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: David Wolfskill , current@freebsd.org References: <20110317115112.GA3723@albert.catwhisker.org> In-Reply-To: <20110317115112.GA3723@albert.catwhisker.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: Re: /etc/rc.d/powerd vs. lack of OID dev.cpu.0.freq X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2011 12:58:35 -0000 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@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