From owner-freebsd-mobile@FreeBSD.ORG Thu Nov 6 16:22:26 2008 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45721106567E; Thu, 6 Nov 2008 16:22:26 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 1BC9F8FC1F; Thu, 6 Nov 2008 16:22:25 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id mA6GMOcR008069 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 6 Nov 2008 08:22:25 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <491319C0.8090201@freebsd.org> Date: Thu, 06 Nov 2008 08:22:24 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20071125) MIME-Version: 1.0 To: Alexander Motin References: <200811060901400000@466321507> In-Reply-To: <200811060901400000@466321507> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-Rhyolite-Metrics: ebb.errno.com; whitelist Cc: freebsd-mobile@freebsd.org Subject: Re: RFC: powerd algorithms enhancements 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: Thu, 06 Nov 2008 16:22:26 -0000 Alexander Motin wrote: >> The biggest problem I see with powerd is that when a system is running >> with a reduced clock frequency interrupts are not processed at full >> clock speed. This, for example, breaks the ath driver which can >> generate interrupts very quickly when h/w MIB counters overflow in a >> noisy environment. Because processing happens at the reduced frequency >> until powerd gets to run it causes livelock >> > > You wanted to say that ath driver/hardware unable to operate on slow CPUs? Ok, but may be it is an ath driver problem? May be it must use some kind of interrupt moderation to avoid it? > You didn't understand me. I used ath as an example of the general problem. > >> (or perhaps powerd does not >> raise the clock frequency because it's only accounting for user code--I >> haven't looked). >> > > powerd counts all nonidle load from system CPU stats. My patch makes it even more accurate in some cases. > > >> There's been talk about temporarily boosting the clock frequency in the >> kernel when processing interrupts. >> > > I am not sure it is a good idea. First, CPU may not be able to adapt it's power (voltage) level so fast, and the second, one of powerd goals is to deny CPU reach full frequency until it is really needed to reduce peak current cunsumption which will drain battery faster. > > I believe other systems use strategies similar to what I described. John Baldwin and I have talked about this in the past. I was just trying to get you interested in looking at a more important problem. Sam