From owner-freebsd-amd64@freebsd.org Tue Sep 8 12:52:50 2015 Return-Path: Delivered-To: freebsd-amd64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1A50A00872 for ; Tue, 8 Sep 2015 12:52:50 +0000 (UTC) (envelope-from se@freebsd.org) Received: from mailout04.t-online.de (mailout04.t-online.de [194.25.134.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B3BD12EB; Tue, 8 Sep 2015 12:52:50 +0000 (UTC) (envelope-from se@freebsd.org) Received: from fwd36.aul.t-online.de (fwd36.aul.t-online.de [172.20.26.137]) by mailout04.t-online.de (Postfix) with SMTP id 711AE35FAD3; Tue, 8 Sep 2015 14:43:45 +0200 (CEST) Received: from [192.168.119.17] (GvUMUmZFYhlFisTMvJk8XAtEU8yVYv8WgHGq2-UK7wFEMKc-ZPAzh2T9idZswVIwbs@[87.151.210.156]) by fwd36.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1ZZIFP-4ekj7A0; Tue, 8 Sep 2015 14:43:39 +0200 Subject: Re: Something odd with CPU frequency levels on AMD EE processors To: Jukka Ukkonen References: <55EE7928.1000804@gmail.com> From: Stefan Esser X-Enigmail-Draft-Status: N1110 Cc: FreeBSD AMD64 Message-ID: <55EED7F6.4060602@freebsd.org> Date: Tue, 8 Sep 2015 14:43:34 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55EE7928.1000804@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-ID: GvUMUmZFYhlFisTMvJk8XAtEU8yVYv8WgHGq2-UK7wFEMKc-ZPAzh2T9idZswVIwbs X-TOI-MSGID: 8d2a69d2-6d55-4413-9b2e-e6b1bffa7248 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2015 12:52:50 -0000 Am 08.09.2015 um 07:59 schrieb Jukka Ukkonen: > > Hello all, > > Previously my AMD EE CPUs have been reporting frequency levels all > the way down to 100 MHz and powerd also used those quite nicely. > Yesterday I noticed the fans running at much higher speed than what > has been normal on a mostly idle system. Now "sysctl dev.cpu.0" > shows me this... > > dev.cpu.0.cx_usage: 100.00% last 622us > dev.cpu.0.cx_lowest: C8 > dev.cpu.0.cx_supported: C1/1/0 > dev.cpu.0.freq_levels: 1700/3870 1500/3461 1300/3105 1100/2720 800/2193 > dev.cpu.0.freq: 800 > dev.cpu.0.temperature: 34.6C > dev.cpu.0.%parent: acpi0 > dev.cpu.0.%pnpinfo: _HID=none _UID=0 > dev.cpu.0.%location: handle=\_PR_.P001 > dev.cpu.0.%driver: cpu > dev.cpu.0.%desc: ACPI CPU > > The system no longer sees the lower CPU frequency levels at all. > Obviously it will not try using them either. Power savings result from lower processor core voltage requirements at lower clock rates (power goes up qudratic with voltage). The numbers behind the slash are nominal power requirements (at 100% CPU) when a certain frequency and corresponding voltage are effective. (E.g. nominal 3,87W at 1700 MHz, 2,193W at 800 MHz for your processor.) The other frequencies that you observed were not clock rates, but effective clocks after injection of "wait cycles" (e.g. 1 one in 8 clocks used to perform any computation, but the clock frequency is still 800 MHz). This throttling had been introduced in the Pentium-4 with its high power consumption to limit absolute power dissipation (to prevent damage to the CPU die). But performance is much more reduced than power consumption, since the CPU voltage is not reduced during throttling. The result is, that the CPU consumes nearly the same power as if it was not throttling, but takes up to 8 times as long to perform computations (before it can fall into a power saving deep sleep) and it needs more electrical energy to deal with a given workload. Throttling tends to increase power consumption and caused numerous problems including system freezes. It has been disabled by default, since the problem of the overheating P4 has seen much better solutions over the last decade. > This change must have been quite recent. Otherwise I would have > noticed the fans running at unusually high speeds much earlier > than yesterday evening. In any case now the idle system consumes > much more power than it really needs to producing only heat which > is exactly what I had tried to avoid when choosing the EE CPUs. What is your low power CPU sleep state? Since CPUs shut down most circuitry when unused for even a fraction of a millisecond, these sleeps are the best way to reduce power consumption and dissipation. > Here is the output from "uname -a" showing the OS version, the SVN > version number, and the time of the latest build. > > FreeBSD sleipnir 10.2-STABLE FreeBSD 10.2-STABLE #0 r287529: Mon Sep 7 > 09:39:36 EEST 2015 root@sleipnir:/usr/obj/usr/src-10.2/sys/Sleipnir > amd64 > > I hope someone has an idea what has happened. I would really like > to enable the lower frequency levels again as soon as possible. Well, you can by just enabling throttling again, by adding the following two lines to /boot/loader.conf: hint.p4tcc.0.disabled="0" hint.acpi_throttle.0.disabled="0" But you really should check your power save settings. E:g. on my i7/2600: dev.cpu.0.cx_method: C1/mwait/hwc C2/mwait/hwc C3/mwait/hwc dev.cpu.0.cx_usage_counters: 2249176 229399 26095890 dev.cpu.0.cx_usage: 7.87% 0.80% 91.32% last 26975us dev.cpu.0.cx_lowest: C8 dev.cpu.0.cx_supported: C1/1/1 C2/2/80 C3/3/104 My system supports C3 as the deepest power state and it seems to use it quite often (91%). What's your setting of performance_cx_lowest and economy_cx_lowest? I have the following in my rc.conf: performance_cx_lowest="Cmax" # Online CPU idle state economy_cx_lowest="Cmax" # Offline CPU idle state And what about powerd: powerd_enable="YES" powerd_flags="-r 75 -i 95" powerd_flags="-a hiadaptive -n hiadaptive" But powerd may also be of no use for your system - some modern CPUs are more efficient when always run at the highest possible clock rate (to complete the given task as quickly as possible and then be able to fall into a deep sleep state). E.g. the new Intel Core i7/6xxx CPUs will even boost the clock of a core to increase the sleep time (instead of lowering the clock to be able to reduce the CPU voltage). Regards, STefan