From owner-freebsd-acpi@FreeBSD.ORG Mon Nov 4 22:03:48 2013 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 88B2F90F for ; Mon, 4 Nov 2013 22:03:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 597012690 for ; Mon, 4 Nov 2013 22:03:48 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 09678B972; Mon, 4 Nov 2013 17:03:47 -0500 (EST) From: John Baldwin To: freebsd-acpi@freebsd.org Subject: Re: Xeon E5 cpu work in low status Date: Mon, 4 Nov 2013 14:53:03 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201311041453.03864.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 Nov 2013 17:03:47 -0500 (EST) Cc: Kevin Oberman , =?utf-8?q?=E6=9D=8E=E6=A3=AE?= X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2013 22:03:48 -0000 On Monday, November 04, 2013 12:52:53 pm Kevin Oberman wrote: > On Mon, Nov 4, 2013 at 12:46 AM, =E6=9D=8E=E6=A3=AE = wrote: >=20 > > hi,all: > > the cpu of my machine is : Intel(R) Xeon(R) CPU E5-2643 0 @ > > 3.30GHz. > > > > after a reboot. The cpu freq is : sysctl dev.cpu.0.freq > > dev.cpu.0.freq: 1200 > > > > i didn't set any power savings config in rc.conf. > > > > How can i fix this? > > >=20 > It's not clear what is broken. Is the server busy? Is there some reason to > expect it to be running at full clock-rate? >=20 > What is the content of dev.cpu.0.freq_levels? >=20 > By default, FreeBSD runs powerd and that will, by default, throttle back > the clock when the system is not busy. I think that this is a bad thing., > but it is not a bug. It's by design. I really think, based on my own > testing, research and a major NSF computer center (SDSC), and work done by > mav@ which can be found on the FreeBSD wiki ( > https://wiki.freebsd.org/TuningPowerConsumption), those "power management" > tools are broken by design a they are actually there for thermal control, > not power management and are, at best, break-even, and in most cases are > actually a loser in both power savings and system performance. (There are= a > very few edge cases where they can be beneficial, but as a side effect for > very specific loads under fairly unusual circumstances.) >=20 > To turn off these (mis)features, add the following to /boot/loader.conf: > # Disable CPU throttling > hint.p4tcc.0.disabled=3D1 > hint.acpi_throttle.0.disabled=3D1 >=20 > > All real power management is through the use of EST and CPU sleep (CX) > states. These can provide a big power win at minimal performance impact. > Unfortunately CX states and throttling lay very badly together, probably > because processor designers don't think that TCC and throttling are for > power management, so are not an issue. >=20 > For reasons that have always baffled me, rather than disable the > inappropriate use of thermal management as power management, we disable t= he > most effective power management tools by default. > performance_cx_lowest=3D"HIGH" # Online CPU idle state > economy_cx_lowest=3D"HIGH" # Offline CPU idle state >=20 > Even the comments are confusing: what do "Online" and "Offline" mean? > Offline means running on battery and online means AC power. >=20 > In any case, it's not clear that there is any issue with your system other > than that, by default, FreeBSD tries to really, really hard to manage pow= er > as badly as humanly possible. > The only thing is that powerd is not enabled by default, so it shouldn't be set to 1200 out of the box. I think there have been a few laptops=20 historically that would startup at a lower clock speed (EST) when booted on battery, but I've never heard of that for servers. In terms of thermal throttling vs EST: ideally powerd would only ever use E= ST, and the throttling would be driven by acpi_thermal. Most systems don't hav= e=20 the _TC1/_TC2 methods acpi_thermal needs (I think I've only seen it on olde= r=20 laptops), so that would effectively disable TCC on modern systems. This requires tearing cpufreq apart a bit. It's also not clear what we sho= uld display to the user. The simplest approach would be to only export "absolu= te" frequencies in freq_levels and the current "absolute" frequency as "freq". That would allow powerd to not need any changes. You could use a different sysctl node that is "throttling percent" or some such. If throttling kicked in on a system with TC1/TC2 then 'freq' wouldn't change when the CPU was=20 throttled, only the "throttling percent". =2D-=20 John Baldwin