Date: Mon, 09 Jun 2008 10:45:12 -0700 From: "Kevin Oberman" <oberman@es.net> To: Jeremy Chadwick <koitsu@FreeBSD.org> Cc: Evren Yurtesen <yurtesen@ispro.net>, freebsd-stable@freebsd.org, John Baldwin <jhb@freebsd.org>, Andrew Snow <andrew@modulus.org> Subject: Re: cpufreq broken on core2duo Message-ID: <20080609174512.60E124501A@ptavv.es.net> In-Reply-To: Your message of "Sun, 08 Jun 2008 22:30:35 PDT." <20080609053035.GA6859@eos.sc1.parodius.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--==_Exmh_1213033512_82978P Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > Date: Sun, 8 Jun 2008 22:30:35 -0700 > From: Jeremy Chadwick <koitsu@FreeBSD.org> > > On Sun, Jun 08, 2008 at 10:13:43PM -0700, Kevin Oberman wrote: > > > Date: Sat, 7 Jun 2008 09:48:12 -0700 > > > From: Jeremy Chadwick <koitsu@FreeBSD.org> > > > Sender: owner-freebsd-stable@freebsd.org > > > > > > On Sat, Jun 07, 2008 at 05:51:38PM +0300, Evren Yurtesen wrote: > > > > By the way, there is another thing I am wondering about. If I enable HTT > > > > and Intel Enhanced SpeedStep in bios on a 3.00GHZ p4 CPU I see: > > > > > > > > cpu0: <ACPI CPU> on acpi0 > > > > acpi_perf0: <ACPI CPU Frequency Control> on cpu0 > > > > p4tcc0: <CPU Frequency Thermal Control> on cpu0 > > > > cpu1: <ACPI CPU> on acpi0 > > > > est1: <Enhanced SpeedStep Frequency Control> on cpu1 > > > > est: CPU supports Enhanced Speedstep, but is not recognized. > > > > est: cpu_vendor GenuineIntel, msr f2700000f27 > > > > device_attach: est1 attach returned 6 > > > > p4tcc1: <CPU Frequency Thermal Control> on cpu1 > > > > > > > > dev.cpu.0.freq_levels: 1500/27000 1312/23625 1200/13000 1050/11375 900/9750 > > > > 750/8125 600/6500 450/4875 300/3250 150/1625 > > > > dev.acpi_perf.0.freq_settings: 1500/27000 1200/13000 > > > > dev.cpufreq.0.%driver: cpufreq > > > > dev.cpufreq.0.%parent: cpu0 > > > > dev.cpufreq.1.%driver: cpufreq > > > > dev.cpufreq.1.%parent: cpu1 > > > > dev.p4tcc.0.freq_settings: 10000/-1 8750/-1 7500/-1 6250/-1 5000/-1 3750/-1 > > > > 2500/-1 1250/-1 > > > > dev.p4tcc.1.freq_settings: 10000/-1 8750/-1 7500/-1 6250/-1 5000/-1 3750/-1 > > > > 2500/-1 1250/-1 > > > > > > > > and it does not allow me to set the freq. of the cpu. > > > > > > How are you setting the frequency? Are you using powerd? You do not > > > have to enable SpeedStep in your BIOS to achieve throttling CPU clock > > > speed. In fact, I would highly recommend leaving EIST/SpeedStep in the > > > BIOS *disabled*, and let powerd adjust the clock frequency via ACPI. > > > > I must strongly recommend against this. EST is MUCH more efficient on > > its control of power use than simple throttling. So much so that on my > > systems that support EST, I remove cpufreq from the kernel. (In all > > cases, throttling means either simple throttling or throttling by using > > TCC.) > > The reality of the situation is that users cannot use EIST reliably on > FreeBSD. I cannot imagine removing cpufreq would solve the "runtime > went backwards" issue. The EIST problem needs to be fixed. If the > folks who work on it do not have present-day hardware (C2Ds, etc.), I > will be more than happy to purchase them whatever they need. > > > I did quite a bit of testing on power management a year or so ago and > > found that throttling was of value only for controlling CPU temperature. > > For real power management, EST works far better as it adjust frequency > > (actual clock rate) and CPU voltage while throttling just stops and > > starts the clock without changing its actual frequency. (This came as a > > surprise to me about 5 years ago when I first discovered it.) > > As far as I know, the ACPI frequency toggling does in fact adjust the > CPU clock rate -- because the values in dev.cpu.0.freq_levels are > defined by the ACPI configuration on the machine. It claims to adjust clock speed, but it actually simply "skips" cycles. The system clocks at its standard rate or that provided by other power management tools. Since throttling (whether done by the external throttling or TCC) will provide 8 "frequencies". If SpeedStep, EST, or PowerNow is available, it will show 8 times the number of "true" frequencies provided by any of those. (Actually, on my system EST provides 16 "frequencies" of which 4 are actual changes in the clock and the others are from 4 voltages it uses. 4**2 = 16. If you see exactly eight "frequencies" with cpufreq, you have no "true" frequency adjustment. > I'd confirm this, but looking at the kernel code doesn't help -- I > cannot find the definition of the CPUFREQ_LEVELS function or macro. > > > At idle, throttling does exactly nothing. EST reduces voltage on the > > CPU and saves power even when idle. At full CPU load, throttling reduces > > performance and power consumption equally. EST beats it by a slim > > margin. > > I thought the power-saving modes of the CPU (C1E/C2E/C3E/C4E) could be > used *without* enabling EIST. I don't think FreeBSD has kernel or > userland support utilities to enable/disable CPU-level features. > Something like RMClock for Windows would be quite useful. (If you have > the opportunity to run it, do so; you'll see what I mean, re: all the > features being toggleable individually). Yes, C-states are not tied to EST or any "frequency-like" things. And they are a really significant factor in power saving. I'll have to look at RMClock. I am not familiar with it. (I don't normally use Windows, but I can boot it on my laptop.) > > The big win is at moderate load. Throttling can result is very poor > > results for aps like video and music which will place a continuous load > > on the system, but only 20-60% (in the case of my test system). It > > tended to make the system seem sluggish. EST does a much better job in > > this case as it lowers CP voltage and clock rate to maximize performance > > while minimizing power. > > > > If your only concern is keeping the system cool, throttling will do the > > job, but if you want efficient power utilization, use EST if possible. > > In the case est does not attach (e.g. no EIST support enabled in > FreeBSD), the throttling method resorts to simply suspending the system, > then yes I completely agree -- EIST is significantly better than that. If you have no better method than throttling, you have to go with it, but it's way to primitive to be a really big help. FWIW, on my ThinkPad (uni-processor), with no cpufreq in the system, I see: dev.cpu.0.freq_levels: 2000/27000 1750/23625 1600/22600 1400/19775 1333/19666 1166/17207 1066/16733 932/14641 800/13800 700/12075 600/10350 500/8625 400/6900 300/5175 200/3450 100/1725 It is running EST and P4TCC is explicitly disabled in loader.conf. Oh, and my testing showed that TCC did a slightly better job than simple throttling, though they do about the same thing, so the difference is probably not significant. With the current code, if P4TCC is available, it will be used in preference to throttling. Both will never be used together. (That was a good way to lock up your system during the time both were used.) -- R. Kevin Oberman, Network Engineer Energy Sciences Network (ESnet) Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab) E-mail: oberman@es.net Phone: +1 510 486-8634 Key fingerprint:059B 2DDF 031C 9BA3 14A4 EADA 927D EBB3 987B 3751 --==_Exmh_1213033512_82978P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) Comment: Exmh version 2.5 06/03/2002 iD8DBQFITWwokn3rs5h7N1ERAm85AKCYpIStWHoj49HzALQjnT5XUdThTgCfSJnK ol+L6HF6LWyy92txK4MHdKM= =EYtG -----END PGP SIGNATURE----- --==_Exmh_1213033512_82978P--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080609174512.60E124501A>