From owner-freebsd-acpi@FreeBSD.ORG Sun Dec 23 18:07:48 2007 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 9B68216A418 for ; Sun, 23 Dec 2007 18:07:48 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from hu-out-0506.google.com (hu-out-0506.google.com [72.14.214.231]) by mx1.freebsd.org (Postfix) with ESMTP id 24BBC13C457 for ; Sun, 23 Dec 2007 18:07:47 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by hu-out-0506.google.com with SMTP id 28so1675273hub.8 for ; Sun, 23 Dec 2007 10:07:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:message-id:from:to:cc:subject:in-reply-to:references:user-agent:mime-version:content-type:sender; bh=Vitkww5pKzE7Zitl7dxjO05plFH5Kf4z6Lpu/lZgjyk=; b=Yzegc7fzod4SicdmrMacKBYi2o7T4e4j2sUXX3Dyow7BUwtR3wNCgpb2MMGO00fQz2J9+bQ4Il+AGithmB50d6zKmcxVTBq97Ky6iiy7xzKmy8MZPbYTewbkwnEYrvyj0KuGl01y3D5cCpW1PeEzYj8ubN0v1vlYvg5I5Pmau/8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:message-id:from:to:cc:subject:in-reply-to:references:user-agent:mime-version:content-type:sender; b=rQw0YpiJV5jsFMfnLhukGqn8UB+ph0Z7Ju+p65ZlWtvKdnqGjWhY0o122mYiv75VVpWPqg6CrtXxqMHHvPnBFIwGy89F6FaDM9AxQDf2JREpgtm2T2q9/33ja2V/xf0E15r0gsFw8M+gwOQco2JsfZ5NPVFM7ef4olH3La2l0Iw= Received: by 10.82.181.7 with SMTP id d7mr6632208buf.8.1198432289263; Sun, 23 Dec 2007 09:51:29 -0800 (PST) Received: from epsilon.local.gmail.com ( [83.144.140.64]) by mx.google.com with ESMTPS id z34sm5248479ikz.8.2007.12.23.09.51.24 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 23 Dec 2007 09:51:28 -0800 (PST) Date: Sun, 23 Dec 2007 17:50:57 +0000 Message-ID: <86sl1tl2pq.wl%rpaulo@fnop.net> From: Rui Paulo To: Andrey In-Reply-To: <476E8674.5000303@gmail.com> References: <476E8674.5000303@gmail.com> User-Agent: Wanderlust/2.15.5 (Almost Unreal) Emacs/22.1 Mule/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: Rui Cc: freebsd-acpi@FreeBSD.org Subject: Re: powerd doesn't decrease CPU frequency in some cases 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: Sun, 23 Dec 2007 18:07:48 -0000 At Sun, 23 Dec 2007 18:01:56 +0200, Andrey wrote: > > Good time of the day. > > I've noticed that powerd isn't able to decrease CPU frequency on my > laptop (HP Compaq 6710b) as soon as frequency gets highest level. > > I've pottered a bit in the sources and it seems found the root of the issue. > So those who are interested in the subject let consider it. > > For instance my system reports the following frequency levels: > > [silent@beastie][/home/silent]sysctl dev.cpu.0.freq_levels > dev.cpu.0.freq_levels: 2001/35000 2000/35000 1750/30625 1600/25000 > 1400/21875 1200/16000 1050/14000 900/12000 800/14000 700/12250 600/10500 > 500/8750 400/7000 300/5250 > > If I try to adjust current frequency to 2000 MHz then I'll get: > [silent@beastie][/home/silent]sudo sysctl dev.cpu.0.freq=2000 > dev.cpu.0.freq: 300 -> 2001 > Let check: > [silent@beastie][/home/silent]sysctl dev.cpu.0.freq > dev.cpu.0.freq: 2001 > > Thus, as you can see, I have level "2000" which system reports me but > actually I can't to adjust those one exactly because it silently becomes > "2001" > > Well... If I'm not mistaken powerd calculates the current "CPU idle > mark" and if it is more then adopted value (by default 90%) then it > shifts CPU frequency value 1 step down. In my case powerd sticks at > "2001". It is obvious because when powerd decreases CPU frequency from > the highest frequency level we'll get the following scenario: > > +-----------------------+ > | dev.cpu.0.freq=2001 +--<-+ > +-----------+-----------+ | > | | > Y | > +-----------+-----------+ | > | "CPU idle" > 90% | | > +-----------+-----------+ | > | | > Y ^ > +-----------+-----------+ ^ > | powerd shifts freq. | ^ > | 1 step down: | | > | "2001" -> "2000" | | > +-----------+-----------+ | > | | > Y | > +-----------+-----------+ | > | actually we have here | | > | dev.cpu.0.freq == 2001+-->-+ > +-----------------------+ > > > According to the things mentioned above I've came to conclusion that in > my case it is not a good idea to rely on frequency levels reported by > the system. (Also I saw many sysctl mibs (dev.cpu.0.freq) of many other > people. And there were "strange" frequency levels like "2000" and > "2001". Of course I can't state that their systems' behaviors fit my > case. But still...) > > So the simple way out I see is to teach powerd recognize "fake" > frequency levels. Here I suggest a very simple workaround (and may be > quite ugly... sorry I'm not sure if it is my cup of tee) which allows me > to overcome the issue. And I hope it can be useful for smb. else. > > Also I'd like to hear opinions of others. May be there exists another > and simpler way to overcome an issue or even I've missed something or > not aware of something. > > > Thank you. > > > -- > Sincerely, > Andrey Kosachenko I think this is all due to the fact that freq_levels mixes p4tcc, est and others. Try adding: hint.p4tcc.0.disabled=1 hint.acpi_throttle.0.disabled=1 to your /boot/loader.conf Regards. -- Rui Paulo