From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 27 14:43:15 2007 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3595F16A46B for ; Fri, 27 Jul 2007 14:43:15 +0000 (UTC) (envelope-from gahr@gahr.ch) Received: from cpanel03.rubas-s03.net (cpanel03.rubas-s03.net [195.182.222.73]) by mx1.freebsd.org (Postfix) with ESMTP id E806E13C46B for ; Fri, 27 Jul 2007 14:43:14 +0000 (UTC) (envelope-from gahr@gahr.ch) Received: from 80-218-187-205.dclient.hispeed.ch ([80.218.187.205] helo=gahrtop.localhost) by cpanel03.rubas-s03.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1IER26-0002Nl-UC for freebsd-hackers@freebsd.org; Fri, 27 Jul 2007 16:43:10 +0200 Message-ID: <46AA0491.5000203@gahr.ch> Date: Fri, 27 Jul 2007 16:43:29 +0200 From: Pietro Cerutti User-Agent: Thunderbird 2.0.0.5 (X11/20070723) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel03.rubas-s03.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - gahr.ch X-Source: X-Source-Args: X-Source-Dir: Subject: [patch] enhance powerd(8) to handle max temperature X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2007 14:43:15 -0000 Hi list, here is a patch to allow powerd(8) accept a "-t tval" option to set a temperature limit above which performance should be decreased. It's a first draft, and I identified the following problems: - the CPU temperature takes some time to decrease, so powerd keeps decreasing the CPU frequency until the temperature is below the limit. The effect is a "increase to maximum, decrease to minimum, increase to maximum, decrease to minimum, ...." which may not be desirable. - the temperature is retrieved by the hw.acpi.thermal.tz0.temperature sysctl MIB. Support for other methods would be desirable. The patches to powerd.c and powerd.8 are here: http://www.gahr.ch/FreeBSD/patches/powerd.c.diff http://www.gahr.ch/FreeBSD/patches/powerd.8.diff Any comment is welcome! -- Pietro Cerutti PGP Public Key: http://gahr.ch/pgp