From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 7 04:36:02 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4C48106566B for ; Sun, 7 Mar 2010 04:36:02 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 4F8098FC18 for ; Sun, 7 Mar 2010 04:36:02 +0000 (UTC) Received: (qmail 22772 invoked by uid 399); 7 Mar 2010 04:36:01 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 7 Mar 2010 04:36:01 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B932D30.7050307@FreeBSD.org> Date: Sat, 06 Mar 2010 20:36:00 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.7) Gecko/20100218 Thunderbird/3.0.1 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <0ECDEB94-E60E-45C7-98AC-5E948DE4649C@dragondata.com> In-Reply-To: <0ECDEB94-E60E-45C7-98AC-5E948DE4649C@dragondata.com> X-Enigmail-Version: 1.0.1 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: ACPI/power implementation causing performance loss with i7/Nehalem turbo boost X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2010 04:36:02 -0000 On 03/05/10 20:14, Kevin Day wrote: > > Recently I bumped into something very weird. In some CPU heavy workloads, FreeBSD ran faster inside VMware's ESX hypervisor than it did running natively on bare metal. Simple pure CPU applications (such as "openssl speed") would run 10-30% faster on VMware. This seemed very counterintuitive, until I discovered what I believe to be the cause. > > Intel Nehalem and i5/i7 processors have a feature called "Turbo Boost", where the more cores that are inactive (ACPI states C2 or C3) the higher the clock rate of the active cores. In some processors increasing the clock speed by more than 1ghz. On a hunch, I disabled turbo boost (through the BIOS) on our ESX system, and this brought the speeds back on par with the bare metal FreeBSD box. > > So, it seems that the VMware hypervisor is deactivating cores on the CPU when idle, but FreeBSD itself isn't. Is anyone working on giving FreeBSD's idle loop/scheduler the ability to go into deeper sleep states? It seems this would have more than just a power savings benefit now. > > Intel documentation on Turbo Boost: http://download.intel.com/design/processor/applnots/320354.pdf?iid=tech_tb+paper Howdy Kevin, :) Back in December I started a thread on a related topic because my C2D laptop running -current was running much hotter than usual. Several people were kind enough to offer me suggestions about tuning that I think might be applicable in your situation. I think someone else already gave you the URL http://wiki.freebsd.org/TuningPowerConsumption which was very helpful. Here is what I ended up with after some fiddling with the recommendations from there, and from those kind enough to help me: /boot/loader.conf: hw.pci.do_power_nodriver=3 hint.p4tcc.0.disabled=1 hint.acpi_throttle.0.disabled=1 hint.apic.0.clock=0 kern.hz=100 hint.atrtc.0.clock=0 hint.pcm.0.buffersize=65536 hint.pcm.1.buffersize=65536 hw.snd.feeder_buffersize=65536 hw.snd.latency=7 /etc/rc.conf: powerd_enable="yes" # Run powerd to lower our power usage. powerd_flags="-a adaptive -b adaptive -n adaptive" performance_cpu_freq="NONE" # Online CPU frequency economy_cpu_freq="NONE" # Offline CPU frequency performance_cx_lowest="C3" # Online CPU idle state economy_cx_lowest="C3" # Offline CPU idle state hth, Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/