[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1009081626460.2477@localhost6.localdomain6>
Date: Wed, 8 Sep 2010 16:30:07 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Joakim Tjernlund <joakim.tjernlund@...nsmode.se>
cc: Eric Dumazet <eric.dumazet@...il.com>,
linux-kernel@...r.kernel.org, Peter Zijlstra <peterz@...radead.org>
Subject: Re: slow nanosleep?
On Wed, 8 Sep 2010, Joakim Tjernlund wrote:
> Thomas Gleixner <tglx@...utronix.de> wrote on 2010/09/08 15:52:23:
> > On Wed, 8 Sep 2010, Joakim Tjernlund wrote:
> > >
> > > 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.
>
> This helps for short(1 ns) nanosleeps, sleeps for 25 us. No idea
> if this is any good, just tossing it out for you to tear apart :)
>
> diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
> index 5c69e99..e612016 100644
> --- a/kernel/hrtimer.c
> +++ b/kernel/hrtimer.c
> @@ -1545,6 +1545,9 @@ long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
> HRTIMER_MODE_ABS);
> hrtimer_set_expires_tv64(&t.timer, restart->nanosleep.expires);
>
> + if (!hrtimer_active(&t.timer))
> + goto out;
That actually will return for any expiry time. The timer is armed in
do_nanosleep() not in hrtimer_set_expires_tv64() /
hrtimer_set_expires_range_ns()
Thanks,
tglx
--
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