From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 30 11:11:53 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 82EEC1065674; Mon, 30 Aug 2010 11:11:53 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id DBC1E8FC16; Mon, 30 Aug 2010 11:11:52 +0000 (UTC) Received: by fxm4 with SMTP id 4so3618647fxm.13 for ; Mon, 30 Aug 2010 04:11:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=tbdatZTXKlGBKk72wv8EqKXyqlsX/gMONSseAPKrhvI=; b=XEnBAujXa3zAopSkBoIng7Y9+jFuHrtlI23/pwkcfctPD3s3/gjxpb4vsBIkdrBOtC GM2+Xy7zu7LMd1VVbBdIJKZuRjcD870vn32VkTLRVY7WyMO0/JOpD9mkO8V1NFbpwmN3 DGx9MBF5ol1KfNmDX/s/J0JZaKXQsEp+1PyDY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=C0LywlV1KbcW9motluGQg8VDHSPODcd3LDzWmmx9rz+VxjJb1U9QPSXMIUwukBAKKs +E43OGvoRORbHCzbfSGcc7IASHhJlZnVVOaXPoMpwOXVIG4lTRaYOxdwzJfMuTxT28D6 vLic4kTMQbjnPhxljf3v2XwlXdLN/cIWL74hk= Received: by 10.223.126.68 with SMTP id b4mr3581088fas.96.1283166711881; Mon, 30 Aug 2010 04:11:51 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id r8sm3252188faq.10.2010.08.30.04.11.50 (version=SSLv3 cipher=RC4-MD5); Mon, 30 Aug 2010 04:11:51 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C7B91EC.5070906@FreeBSD.org> Date: Mon, 30 Aug 2010 14:11:40 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: "YAMAMOTO, Taku" References: <4C7A5C28.1090904@FreeBSD.org> <20100830110932.23425932@ernst.jennejohn.org> <4C7B82EA.2040104@FreeBSD.org> <20100830195941.9731109c.taku@tackymt.homeip.net> In-Reply-To: <20100830195941.9731109c.taku@tackymt.homeip.net> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 11:11:53 -0000 YAMAMOTO, Taku wrote: > 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. Thank you for the hint. I will investigate it now. But it still help only x86 systems. I have no idea how power management works on arm/mips/ppc/..., but I assume that periodic wake up there also may be not free. -- Alexander Motin