Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754201Ab0AaAqb (ORCPT ); Sat, 30 Jan 2010 19:46:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754035Ab0AaAq3 (ORCPT ); Sat, 30 Jan 2010 19:46:29 -0500 Received: from casper.infradead.org ([85.118.1.10]:46115 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753406Ab0AaAq1 (ORCPT ); Sat, 30 Jan 2010 19:46:27 -0500 Date: Sat, 30 Jan 2010 16:47:16 -0800 From: Arjan van de Ven To: Shawn Bohrer Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra Subject: Re: High scheduler wake up times Message-ID: <20100130164716.230dfe31@infradead.org> In-Reply-To: <20100131003549.GC27390@mediacenter.gateway.2wire.net> References: <20100130234551.GA27390@mediacenter.gateway.2wire.net> <20100130161114.07278221@infradead.org> <20100131003549.GC27390@mediacenter.gateway.2wire.net> Organization: Intel X-Mailer: Claws Mail 3.7.3 (GTK+ 2.16.6; i586-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1539 Lines: 44 On Sat, 30 Jan 2010 18:35:49 -0600 Shawn Bohrer wrote: \ > > I agree that we are currently depending on a bug in epoll. The epoll > implementation currently rounds up to the next jiffie, so specifying a > timeout of 1 ms really just wakes the process up at the next timer > tick. I have a patch to fix epoll by converting it to use > schedule_hrtimeout_range() that I'll gladly send, but I still need a > way to achieve the same thing. it's not going to help you; your expectation is incorrect. you CANNOT get 1000 iterations per second if you do etc in a loop the more accurate (read: not rounding down) the implementation, the more not-1000 you will get, because to hit 1000 the two actions combined are not allowed to take more than 1000 microseconds wallcock time. Assuming "do a bunch of work" takes 100 microseconds, for you to hit 1000 there would need to be 900 microseconds in a milliseconds... and sadly physics don't work that way. (and that's even ignoring various OS, CPU wakeup and scheduler contention overheads) -- Arjan van de Ven Intel Open Source Technology Centre For development, discussion and tips for power savings, visit http://www.lesswatts.org -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/