Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 06 Mar 2010 20:36:00 -0800
From:      Doug Barton <dougb@FreeBSD.org>
To:        freebsd-hackers@freebsd.org
Subject:   Re: ACPI/power implementation causing performance loss with i7/Nehalem turbo boost
Message-ID:  <4B932D30.7050307@FreeBSD.org>
In-Reply-To: <0ECDEB94-E60E-45C7-98AC-5E948DE4649C@dragondata.com>
References:  <0ECDEB94-E60E-45C7-98AC-5E948DE4649C@dragondata.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B932D30.7050307>