From owner-freebsd-mobile@FreeBSD.ORG Mon Jan 2 06:27:33 2012 Return-Path: Delivered-To: mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99B8F106564A; Mon, 2 Jan 2012 06:27:33 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) by mx1.freebsd.org (Postfix) with ESMTP id D07348FC16; Mon, 2 Jan 2012 06:27:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id q025q0wk040648; Mon, 2 Jan 2012 16:52:01 +1100 (EST) (envelope-from smithi@nimnet.asn.au) Date: Mon, 2 Jan 2012 16:52:00 +1100 (EST) From: Ian Smith To: "Julian H. Stacey" In-Reply-To: <201201020313.q023DdG2051231@fire.js.berklix.net> Message-ID: <20120102153310.A66248@sola.nimnet.asn.au> References: <201201020313.q023DdG2051231@fire.js.berklix.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Alexander Motin , brucec@freebsd.org, mobile@freebsd.org, Hajimu UMEMOTO Subject: Re: powerd to use sysctl to import temps to drop freq to avoid heat crash X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 06:27:33 -0000 On Mon, 2 Jan 2012 04:13:38 +0100, Julian H. Stacey wrote: > Hi mobile@freebsd.org, CC a few others. Hi Julian. Trimmed some, added ume@, feel free .. > I propose to hack src/usr.sbin/powerd/powerd.c > To import temperatures via sysctl, & if too high, to forcibly > reduce CPU frequency, even if CPU load is high, > because my new HP Pavillion notebook keeps over heating & crashing. As ume@ points out, passive cooling _should_ be handling this, and in any case - even if you get a forced shutdown at CRT temp. - it shouldn't be 'crashing'. Please elaborate on 'crashing'? and at what sort of temperature this occurs? > dmesg & sysctl etc diagnostics at > http://berklix.com/~jhs/hardware/hp/pavilion/dm3-1155ea/ > CPU: AMD Athlon(tm) Neo X2 Dual Core Processor L335 (1595.96-MHz K8-class CPU) > Origin = "AuthenticAMD" Id = 0x60fb2 Family = f Model = 6b Stepping = 2 Almost too much info :) esp. with sysctl -a including the verbose dmesg, but I noticed a couple of things on a quick skim. If you run powerd -v, what sort of freqs does it usually run at, when more or less idle? Are you using default powerd settings? When running on battery can you monitor power use with acpiconf -i0 to see the actual effect on power usage of running at various lower freqs? I see dev.powernow.0.freq_settings: 1592/100000 796/35457 ie just two speeds, with dmesg showing: acpi_throttle0: on cpu0 acpi_throttle0: P_CNT from P_BLK 0x410 powernow0: on cpu0 powernow1: on cpu1 If you disabled acpi_throttle0 in loader, you won't get all those N/8 rates from throttling. I'm not sure, esp on AMD hardware, whether those rates actually provide any cooling benefit or not. I guess you've read mav@'s power tuning guide for hints on reducing power (thus, heat)? I also notice only C1 states, but using machdep.idle: amdc1e so I wonder if you're getting benefit from that? Are there BIOS settings re that? > Is this re-inventing the wheel ? > Anyone else out there working on or know of similar code ? A few people have been down this road, you'd need to search the acpi@ archives from a few years ago. Nate Lawson was then firmly opposed to the idea, but you'll find some code there, in various older PRs too, though it seems none of those are still 'open'. > mgdiff 8.2-RELEASE/src/usr.sbin/powerd/powerd.c \ > /pub/FreeBSD/branches/-current/src/usr.sbin/powerd/powerd.c > does not show a lot of difference. > > >From > http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/powerd/powerd.c > I added a few people to CC particularly mav@ has an interesting comment > Wed Jun 16 15:09:45 2010 UTC ( > Freq sysctls are quite heavy due to set of malloc()/free() > calls. Avoid reading current frequency on every period. > Instead do it only after changing and periodically from > time to time if somebody else change it. > > Also dynamically decrease sampling frequency up to 4 times > on inactivity, > > Gary J: there's a comment at Fri Jan 9 22:10:07 2009 re. more then 2 CPUs > > I added Clive who may have some URL to CPU temps. > > To > /boot/loader.conf > I just added > acpi_hp_load="YES" > (after reboot) does not produce /dev/hpcmi I don't see any mention of active cooling (ie, fan/s) in your sysctls, including acpi_hp. Here I'm running a custom script to control CPU fan via acpi_ibm (the auto fan didn't cut in till over 65C, then pumped it down to ~45C), but it seems you may not have access to fan control? You could try setting hw.acpi.thermal.user_override=1 and then set hw.acpi.thermal.tz0._PSV to something lower than 90C, perhaps much lower to see if it helps, especially if 'crashing' occurs closer to 90C than not, however: > Running 80% idle (just a fsck_ufs) I see: > hw.acpi.thermal.tz0.temperature: 67.0C > dev.acpi_hp.0.hdd_temperature: 4 67C isn't really hot on a dual core laptop with 100W rating at 1592MHz. Still, if you had it drop back immediately on idle to 796MHz, you'd be saving about 60W, which may help considerable. I expect you've done the usual check/clean airways, thermal grease etc? Just a few quick notes, I've no time for deep diving lately .. HTH. cheers, Ian