From owner-freebsd-current@FreeBSD.ORG Wed Feb 2 20:03:54 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3263D16A4CE; Wed, 2 Feb 2005 20:03:54 +0000 (GMT) Received: from www.cryptography.com (li-22.members.linode.com [64.5.53.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id CEB1643D55; Wed, 2 Feb 2005 20:03:51 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.0.34] (adsl-67-119-74-222.dsl.sntc01.pacbell.net [67.119.74.222]) by www.cryptography.com (8.12.8/8.12.8) with ESMTP id j12K3oWk031180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 2 Feb 2005 12:03:51 -0800 Message-ID: <42013223.4080704@root.org> Date: Wed, 02 Feb 2005 12:03:47 -0800 From: Nate Lawson User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Colin Percival References: <41FFB53B.3020907@root.org> <42012739.9080501@freebsd.org> In-Reply-To: <42012739.9080501@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: acpi@freebsd.org cc: current@freebsd.org Subject: Re: New cpufreq framework and drivers X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Wed, 02 Feb 2005 20:03:54 -0000 Colin Percival wrote: > Nate Lawson wrote: > >> Hardware drivers are of two types, absolute >> and relative. SpeedStep, Powernow, etc. are absolute drivers in that >> they set the cpu's base frequency. ACPI throttling, Longrun, etc. are >> relative drivers that reduce the processor's clock to a fraction of >> its current base (i.e., they have an additive effect.) > > > If my first glance at the patch is correct, this would have my laptop (a > 1.4GHz > Pentium M) reporting the availability of the frequencies 600MHz, 800MHz, > etc. > from enhanced speedstep, along with the frequencies 300MHz, 400MHz, > 500MHz, and > 700MHz obtained via 50% clock throttling. That is correct. The code to support relative drivers was removed before posting to give the basic framework more testing before I commit it shortly. The relative support will go in soon after that code is committed. There are a lot of nuances that you'll see when I post the relative states patch. For instance, if a state has the same frequency of another state, the one with the lower power consumption is preferred. > While this in itself is entirely valid, a clock speed of 700MHz obtained by > running the processor at 1400MHz with a 50% "duty cycle" would draw more > power > than a clock speed of 800MHz obtained by running the processor at 800MHz > with > a lower voltage; is there any mechanism to inform userland daemons of such > oddities? I would hate to see a daemon lowering the clock speed from > 800MHz > to 700MHz in an attempt to save power... If you look at the kernel interface (sys/sys/cpu.h, struct cf_setting), you'll see that frequency, power, latency, and other values are available. The user sysctl interface exports frequency/power values as follows: dev.cpu.0.freq=733 dev.cpu.0.freq_levels=1000/18200 733/15100 That is Mhz and mW, respectively. With synthetic states (ones derived from a base absolute frequency and a modifying relative frequency), the cpufreq framework builds a power estimate. For example, a level comprised of 1400 Mhz at 20000 mW and a 50% relative setting would have an exported power of 10000 mW since relative drivers give a linear reduction in power consumption. Your absolute setting of 800 Mhz would likely have a lower power level and so any daemon should take that into consideration. -- Nate