From owner-freebsd-current@FreeBSD.ORG Mon May 4 13:12:26 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD8221065670; Mon, 4 May 2009 13:12:26 +0000 (UTC) (envelope-from gaijin.k@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by mx1.freebsd.org (Postfix) with ESMTP id 5916C8FC27; Mon, 4 May 2009 13:12:25 +0000 (UTC) (envelope-from gaijin.k@gmail.com) Received: by qw-out-2122.google.com with SMTP id 3so2893389qwe.7 for ; Mon, 04 May 2009 06:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=iypo7b7zlz3AwW7Rii0IuyDmz0y5EAe4AmcmAFjM5yg=; b=IKTbdOeNRmOyTLwZjzkrxA45DSu53hM9yAT9k3MbJEvJ0V+U+Y0AlY14kUGzHSCVsG 3TyNMC97zZdf/2wBETeoAx5XG0Wxc68ctlR1xBVV1aLcNMkk6vHkX95vYjo4hGG4sgvq 8oigwhjRc5DWaZz8yiqgDjzZIa6b4kLYbu4Dk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=riT3LkSGTUGTQOffl9OMoXGA8Uhry9jVlN963nhGmG41saIETpuGzlJJHQpsILItY5 ZcPgIviH80RrG9onXJmFD4tmotXu+jPDHPG16lc7dOKyx03r8Jbw8ccOYWcptXr3ORtW Ee3pl/G2xuM2m7wQHNGNSBpDqxDS6mGG7u0K8= Received: by 10.224.80.134 with SMTP id t6mr5686248qak.173.1241439011846; Mon, 04 May 2009 05:10:11 -0700 (PDT) Received: from ?10.0.3.231? (pool-70-111-23-127.nwrk.east.verizon.net [70.111.23.127]) by mx.google.com with ESMTPS id 7sm9754803qwf.55.2009.05.04.05.10.10 (version=SSLv3 cipher=RC4-MD5); Mon, 04 May 2009 05:10:11 -0700 (PDT) From: "Alexandre \"Sunny\" Kovalenko" To: Alexander Motin In-Reply-To: <49FE1826.4060000@FreeBSD.org> References: <49FE1826.4060000@FreeBSD.org> Content-Type: text/plain; charset="UTF-8" Date: Mon, 04 May 2009 08:09:50 -0400 Message-Id: <1241438990.1280.6.camel@RabbitsDen> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 8bit Cc: FreeBSD acpi , FreeBSD-Current , freebsd-mobile@freebsd.org Subject: Re: Fighting for the power. 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: Mon, 04 May 2009 13:12:27 -0000 On Mon, 2009-05-04 at 01:18 +0300, Alexander Motin wrote: > I would like to summarize some of my knowledge on reducing FreeBSD power > consumption and describe some new things I have recently implemented in > 8-CURRENT. The main character of this story is my 12" Acer TravelMate > 6292 laptop with C2D T7700 2.4GHz CPU, 965GM chipset and SATA HDD, under > amd64 8-CURRENT. > > Modern systems, especially laptops, are implementing big number of > power-saving technologies. Some of them are working automatically, other > have significant requirements and need special system tuning or > trade-offs to be effectively used. > > So here is the steps: > > 1. CPU > CPU is the most consuming part of the system. Under the full load it > alone may consume more then 40W of power, but for real laptop usage the > most important is idle consumption. > Core2Duo T7700 CPU has 2 cores, runs on 2.4GHz frequency, supports EIST > technology with P-states at 2400, 2000, 1600, 1200 and 800MHz levels, > supports C1, C2 and C3 idle C-states, plus throttling. So how can we use it: > P-states and throttling > Enabling powerd allows to effectively control CPU frequency/voltage > depending on CPU load. powerd on recent system can handle it quite > transparently. By default, frequency controlled via mix of EIST and > throttling technologies. First one controls both core frequency and > voltage, second - only core frequency. Both technologies give positive > power-saving effect. But effect of throttling is small and can be > completely hidden by using C2 state, that's why I recommend to disable > throttling control by adding to /boot/loader.conf: > hint.p4tcc.0.disabled=1 > hint.acpi_throttle.0.disabled=1 > In my case frequency/voltage control saves about 5W of idle power. > C-states > - C1 stops clock on some parts of CPU core during inactivity. It is > safe, cheap and supported by CPUs for ages. System uses C1 state by default. > - C2 state allows CPU to turn off all core clocks on idle. It is also > cheap, but requires correct ACPI-chipset-CPU interoperation to be used. > Use of C2 state can be enabled by adding to /etc/rc.conf: > performance_cx_lowest="C2" > economy_cx_lowest="C2" > Effect from this state is not so big when powerd is used, but still > noticeable, > - C3 state allows CPU completely stop all internal clocks, reduce > voltage and disconnect from system bus. This state gives additional > power saving effect, but it is not cheap and require trade-offs. > As soon as CPU is completely stopped in C3 state, local APIC timers in > each CPU core, used by FreeBSD as event sources on SMP, are not > functioning. It stops system time, breaks scheduling that makes system > close to dead. Did you try to see whether putting one of the cores in C3 state by doing something like dev.cpu.1.cx_lowest=C3 makes any difference? # sysctl dev.cpu | grep cx_usage dev.cpu.0.cx_usage: 0.00% 100.00% 0.00% dev.cpu.1.cx_usage: 0.00% 5.18% 94.81% -- Alexandre Kovalenko (Олександр Коваленко)