From owner-freebsd-acpi@FreeBSD.ORG Thu Jan 31 12:15:55 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 CF5FE16A417 for ; Thu, 31 Jan 2008 12:15:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 4F43D13C469 for ; Thu, 31 Jan 2008 12:15:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8s) with ESMTP id 230312653-1834499 for multiple; Thu, 31 Jan 2008 07:14:34 -0500 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m0VCFpqW018988; Thu, 31 Jan 2008 07:15:51 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-acpi@freebsd.org Date: Thu, 31 Jan 2008 05:35:15 -0500 User-Agent: KMail/1.9.7 References: <1201733779.902.18.camel@RabbitsDen> In-Reply-To: <1201733779.902.18.camel@RabbitsDen> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801310535.15540.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 31 Jan 2008 07:15:51 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/5622/Thu Jan 31 06:00:29 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: "Alexandre \"Sunny\" Kovalenko" 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: Thu, 31 Jan 2008 12:15:55 -0000 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 Baldwin