From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753721Ab0IHNwk (ORCPT ); Wed, 8 Sep 2010 09:52:40 -0400 Received: from www.tglx.de ([62.245.132.106]:36542 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751098Ab0IHNwh (ORCPT ); Wed, 8 Sep 2010 09:52:37 -0400 Date: Wed, 8 Sep 2010 15:52:23 +0200 (CEST) From: Thomas Gleixner To: Joakim Tjernlund cc: Peter Zijlstra , Eric Dumazet , linux-kernel@vger.kernel.org Subject: Re: slow nanosleep? In-Reply-To: Message-ID: References: <1283932600.2880.1.camel@edumazet-laptop> <1283934289.2880.12.camel@edumazet-laptop> <1283950818.23762.20.camel@laptop> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 8 Sep 2010, Joakim Tjernlund wrote: > Peter Zijlstra wrote on 2010/09/08 15:00:18: > > > > On Wed, 2010-09-08 at 14:43 +0200, Thomas Gleixner wrote: > > > > However nanosleep with 1 ns and prctl(PR_SET_TIMERSLACK, 1) takes > > > > about 8 us on x86(Intel(R) Core(TM)2 Duo CPU E8500 @ 3.16GHz) > > > > and 20 us on my slower ppc board. Is that system call overhead > > > > or possibly some error? > > > > > > That's overhead I fear. We go way up to enqueue/arm the timer until we > > > figure out that the timeout already happened. > > > > Well, there's also the fact that his ppc board is simply dead slow, > > using the freq ratio: 3166/266 you'd expect (at a similar ins/clock > > ratio) the ppc to take 95us. > > > > So in fact the pcc taking 20us is actually quite good. > > Actually, it takes 120 us. The 20 us was when I had Thomas > timeout == 0 fast path patch applied(forgot to remove it). > Without that patch it takes about 115 us. So it seems it takes > 115-20=95 us to turn the timer wheel on my ppc. You might fire up the tracer to look where it spends that time. Thanks, tglx