From owner-freebsd-acpi@FreeBSD.ORG Tue Feb 5 10:23:06 2008 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBD0716A46C; Tue, 5 Feb 2008 10:23:06 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from gaia.nimnet.asn.au (nimbin.lnk.telstra.net [139.130.45.143]) by mx1.freebsd.org (Postfix) with ESMTP id 6DFC813C478; Tue, 5 Feb 2008 10:23:03 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from localhost (smithi@localhost) by gaia.nimnet.asn.au (8.8.8/8.8.8R1.5) with ESMTP id VAA08751; Tue, 5 Feb 2008 21:22:55 +1100 (EST) (envelope-from smithi@nimnet.asn.au) Date: Tue, 5 Feb 2008 21:22:54 +1100 (EST) From: Ian Smith To: "Alexandre \"Sunny\" Kovalenko" In-Reply-To: <1202185241.821.8.camel@RabbitsDen> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Cc: freebsd-acpi@freebsd.org, Johannes Dieterich Subject: Re: [RFC] Patch to enable temperature ceiling in powerd X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2008 10:23:06 -0000 On Mon, 4 Feb 2008, Alexandre "Sunny" Kovalenko wrote: > On Thu, 2008-01-31 at 05:35 -0500, John Baldwin wrote: > > On Wednesday 30 January 2008 05:56:19 pm Alexandre "Sunny" Kovalenko wrote: > > > Some time ago I have put together patch for powerd, which allows user to > > > specify the temperature threshold at which powerd will lower CPU > > > frequency no matter what the load was at the time. I recently had to > > > adapt it to the 7.0-PRERELEASE for someone with the overheating laptop, > > > which got me to think that it might be useful for someone else yet. > > > > > > Basic idea is fairly simple -- check temperature in TZ0 and, if it has > > > reached certain value, either override frequency with the lowest > > > available (in the case of 'max' setting) or change idle time to 100% and > > > let adaptive algorithm decrease frequency gradually. > > > > > > I imagine it also could be poor man's substitute for the low noise > > > acoustic policy ;) > > > > > > If there is an interest, I will go ahead and submit a PR, otherwise it > > > will live in the mail archives for someone to find. Any comments, > > > suggestions or criticisms are welcome. > > > > > > Temperature threshold (in Celsius) could be set by means of '-T' command > > > line option (as in '-T 60'). > > > > A couple of suggestions: > > > > - I would make the default temperature 0 instead of 200 and just disable the > > feature altogether if it is set to 0 (i.e. don't read the current > > temperature and don't do any checks if it is 0). > > - I would allow the temperature to be specified in either C, K or F with a > > suffix to indicate the scale. (e.g., "80C", "120F", "300K") > > - I would let the thermal zone name be configurable with a default of "tz0". > > (e.g. "-z tz3"). You would then snprintf the sysctl mib name that gets > > passed to sysctlbyname(3). > > > John, > I have attached new patch, implementing your suggestions (some of these > were already implemented by Ian Smith and sent to me privately). I have > also attached first crack at the patch to powerd.8. Both patches are > against 7.0 as of late January 31, EST. Alexandre, please remove my gratuitous 4-line comment at the top, it's OTT and was really just to document for myself what I was playing around with then. Though it's implied, I think the mod to powerd(8) should mention that tz0 is the default. Also I think 999C is just a wee bit high to test against, when 150C would melt most laptops (not to mention laps :) I recall seeing 150C tested against somewhere else as a 'reasonable' max. Cheers, Ian > Johannes, > could you, by any chance, apply the attached patch to the original copy > of the powerd.c and see if it still allows you to use your system? Do > not expect any improvements, though ;) > > -- > Alexandre "Sunny" Kovalenko (Олександр Коваленко) >