From owner-freebsd-arch@FreeBSD.ORG Mon Apr 21 20:11:12 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F405C1065673 for ; Mon, 21 Apr 2008 20:11:11 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id C0AA88FC38 for ; Mon, 21 Apr 2008 20:11:11 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper [152.3.145.30]) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id m3LKBAcK007901 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Apr 2008 16:11:10 -0400 (EDT) X-DKIM: Sendmail DKIM Filter v2.5.3 duke.cs.duke.edu m3LKBAcK007901 Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id m3LKAgtw012102; Mon, 21 Apr 2008 16:10:42 -0400 (EDT) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18444.62681.319881.638165@grasshopper.cs.duke.edu> Date: Mon, 21 Apr 2008 16:10:42 -0400 (EDT) To: Jeff Roberson In-Reply-To: <20080419004911.R942@desktop> References: <20080419004911.R942@desktop> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Cc: arch@freebsd.org Subject: Re: monitor/mwait support for idle X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 20:11:12 -0000 Jeff Roberson writes: > http://people.freebsd.org/~jeff/mwait.diff > > This patch implements support for the x86/amd64 monitor and mwait > instructions in the idle loop. This also implements idle loop selection > via a sysctl string. The following loops are supported, in > decreasing order of performance and power consumption: > > spin - Simply returns > mwait - Always use mwait to sleep. CPU enters C0 or C1 depending on > how busy it is. > mwait_hlt - Use mwait when busy but fall back to hlt/acpi when not. > hlt - pure hlt loop > acpi - uses acpi_cpu_idle if available and hlt if not. This is the > default. > Something which may be a bit confusing is that machines like recent Core2 Xeons will go into C1E when hlt is executed, depending on an MSR setting that most BIOSes enable (bit 25, MSR 0x1a0). I think C1E might be a deeper sleep than what is reached by mwait. I confess that I don't know much about C1E, other than it kills network io intensive performance, and I turn off this (mis)feature whenever I can. It will be interesting to see how much mwait helps. I'm sure it will save power over my current workaround of disabling hlt altogether :) Drew