[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <OF82705D74.3C13AE80-ONC1257798.00427DAB-C1257798.0042F243@transmode.se>
Date: Wed, 8 Sep 2010 14:11:13 +0200
From: Joakim Tjernlund <joakim.tjernlund@...nsmode.se>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Eric Dumazet <eric.dumazet@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: slow nanosleep?
Thomas Gleixner <tglx@...utronix.de> wrote on 2010/09/08 11:51:13:
>
> On Wed, 8 Sep 2010, Joakim Tjernlund wrote:
>
> > Eric Dumazet <eric.dumazet@...il.com> wrote on 2010/09/08 10:24:49:
> > >
> > > Le mercredi 08 septembre 2010 à 10:04 +0200, Joakim Tjernlund a écrit :
> > >
> > > > That makes litte difference:
> > > > root@...alhost ~ # ./nanosleep
> > > > nanosleep
> > > > req:0 :0
> > > > tv_res:0 :112
> > > >
> > >
> > > Here, result is 30 (with prctl())
> > > instead of 95 (without)
> >
> > On x86 I notice a difference:
> > 7 vs 57.
> > however select is still faster: 2
> > The system call OH seems to be bigger for nanosleep than
> > for select and on my ppc is is about 112 us. Can anything
> > be done about that?
>
> Hmm, the only reason I can see is that select calls finally
> schedule_hrtimeout_range_clock() which optimizes the expiry = 0 case
> while nanosleep does not. So the difference is only visiable when the
> relative timeout is 0. For timeouts > 0 nanosleep and select should
> behave the same way.
Yes, that is it. Thanks
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?
Jocke
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists