From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 30 10:59:30 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 5C8BE1065693; Mon, 30 Aug 2010 10:59:30 +0000 (UTC) (envelope-from taku@tackymt.homeip.net) Received: from basalt.tackymt.homeip.net (unknown [IPv6:2001:3e0:577:0:20d:61ff:fecc:2253]) by mx1.freebsd.org (Postfix) with ESMTP id 039188FC12; Mon, 30 Aug 2010 10:59:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by basalt.tackymt.homeip.net (Postfix) with ESMTP id E8733107C5; Mon, 30 Aug 2010 19:59:28 +0900 (JST) X-Virus-Scanned: amavisd-new at tackymt.homeip.net Received: from localhost ([127.0.0.1]) by localhost (basalt.tackymt.homeip.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wwOzlbsUSZbK; Mon, 30 Aug 2010 19:59:27 +0900 (JST) Received: from truth.mskc.confortune.co.jp (p0395aa.tokynt01.ap.so-net.ne.jp [121.3.149.170]) by basalt.tackymt.homeip.net (Postfix) with ESMTP; Mon, 30 Aug 2010 19:59:27 +0900 (JST) Date: Mon, 30 Aug 2010 19:59:41 +0900 From: "YAMAMOTO, Taku" To: Alexander Motin Message-Id: <20100830195941.9731109c.taku@tackymt.homeip.net> In-Reply-To: <4C7B82EA.2040104@FreeBSD.org> References: <4C7A5C28.1090904@FreeBSD.org> <20100830110932.23425932@ernst.jennejohn.org> <4C7B82EA.2040104@FreeBSD.org> X-Mailer: Sylpheed 3.0.3 (GTK+ 2.20.1; i386-portbld-freebsd8.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 30 Aug 2010 11:12:19 +0000 Cc: freebsd-hackers@freebsd.org, FreeBSD-Current Subject: Re: One-shot-oriented event timers management 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: Mon, 30 Aug 2010 10:59:30 -0000 On Mon, 30 Aug 2010 13:07:38 +0300 Alexander Motin wrote: > Gary Jennejohn wrote: (snip) > > So, what else did you do to reduce interrupts so much? > > > > Ah, I think I see it now. My desktop has only C1 enabled. Is that it? > > Unfortunately, it appears that only C1 is supported :( > > Yes, as I have said, at this moment empty ticks skipped only while CPU > is in C2/C3 states. In C1 state there is no way to handle lost events on > wake up. While it may be not very dangerous, it is not very good. There's an alternative way to catch exit-from-C1 atomically: use MWAIT with bit0 of ECX set (``Treat masked interrupts as break events'' in Intel 64 and IA-32 Architecthres Software Developer's Manual). In this way we can put each core individually into deeper Cx state without additional costs (SMIs and the like) as a bonus. The problem is that it may be unavailable to earlier CPUs that support MONITOR/MWAIT instructions: we should check the presense of this feature by examining bit0 and bit1 of ECX that is returned by CPUID 5. -- YAMAMOTO, Taku