From owner-freebsd-stable@FreeBSD.ORG Wed Mar 21 17:18:42 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE73A106566C for ; Wed, 21 Mar 2012 17:18:42 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 6BC1F8FC18 for ; Wed, 21 Mar 2012 17:18:42 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id F04E47300A; Wed, 21 Mar 2012 18:37:28 +0100 (CET) Date: Wed, 21 Mar 2012 18:37:28 +0100 From: Luigi Rizzo To: Kevin Oberman Message-ID: <20120321173728.GA41322@onelab2.iet.unipi.it> References: <20120321000058.177F8256@server.theusgroup.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: Matthias Gamsjager , freebsd-stable@freebsd.org, John Subject: Re: powerd and increase in energy need X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2012 17:18:42 -0000 On Wed, Mar 21, 2012 at 09:32:47AM -0700, Kevin Oberman wrote: ... > If you are trying to reduce power consumption, why are you limiting Cx > states to C2 (which save little) and not C3 (which will save a LOT of > power when the CPU is not heavily loaded). > > If it is due to the system hanging, it is almost certainly because you > have throttling enabled. Throttling, either by the use of TCC (also > called P4TCC) or the older, externally implemented throttling > mechanism, is a BAD BAD THING! I have complained for years about it > being the default. It is intended for thermal control, not power > management. The power savings will be negligible and, in combination > with deep sleep modes (Cx > 2) can and do result in the CPU going into > deep sleep and never waking up. > > You can (and should) disable them in /boot/loader.conf with: > # Disable CPU throttling > hint.p4tcc.0.disabled=1 > hint.acpi_throttle.0.disabled=1 > > This should greatly reduce the large number of "frequencies" > available, but they will be the ones provided by EST.which really do > reduce power consumption. (I put frequencies in quotation marks > because throttling does not really change the clock speed. It simply > skips 'N' of every 8 clock cycles. Still, compared to C3 and higher, > EST is a minor power savings. interesting. Can you elaborate on that ? This is one of my new machines, hw.model: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz dev.cpu.0.%desc: ACPI CPU dev.cpu.0.%driver: cpu dev.cpu.0.%location: handle=\_PR_.P000 dev.cpu.0.%pnpinfo: _HID=none _UID=0 dev.cpu.0.%parent: acpi0 dev.cpu.0.freq: 600 dev.cpu.0.freq_levels: 3401/255000 3300/245000 3200/236000 3100/227000 3000/218000 2900/209000 2800/200000 2700/192000 2600/183000 2500/175000 2400/167000 2300/159000 2200/151000 2100/143000 1837/125125 1600/87000 1400/76125 1200/65250 1000/54375 800/43500 600/32625 400/21750 200/10875 dev.cpu.0.cx_supported: C1/1 C2/80 C3/104 dev.cpu.0.cx_lowest: C1 dev.cpu.0.cx_usage: 100.00% 0.00% 0.00% last 210us Here using C1 or C3 does not seem to make any difference at all in terms of power (measured with a Kill-a-watt style wattmeter), and irrespective of the frequency setting the idle power does not change much (48..56W across the entire range). This is on FreeBSD 9 with HZ=1000, maybe some marginal savings can be achieved setting HZ=100 (at some point i will give it a try). Under heavy load (16 threads running infinite loops across the 4 cores) the power goes up as expected (up to 118W for 4 cores, 76W using just 1 core), and powerd seems to do a decent job in keeping the idle power low. I guess that the credit for power saving goes mostly to the CPU architects. Powerd only gives second-order savings, and C1 vs. C3 is ineffective, at least for HZ=1000 CPU Power (watts) freq idle 16 threads ----------------------- 200 48 51 2200 52 83 3200 54 115 3401 56 118 powerd 48 118 cheers luigi