kernel/timer.c
Joakim Tjernlund
joakim.tjernlund at lumentis.se
Sat Apr 12 00:38:31 EST 2003
> Anyone knows why tehere is a line:
>
> expire = timespec_to_jiffies(&t) + (t.tv_sec || t.tv_nsec);
>
> in kernel/timer.c sys_nanosleep
> It adds additional time tick to expire. If anyone uses small HZ value
> (eg 100 which is default for arch-ppc) this causes aditional 10ms delay
> when calling nanosleep.
Yes, after a quick scan it looks like a bug to me. Anyone else?
>
>
> For me ( found by Andrzej Kass)
> it should be:
>
> expire = timespec_to_jiffies(&t) + !(t.tv_sec || t.tv_nsec);
> //^^add extra tick if there is
> // nothing in tv_sec and nothing in tv_nsec
hmm, why not just:
expire = timespec_to_jiffies(&t);
if tv_sec and tv_sec are zero, do you need to sleep at all?
Jocke
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
More information about the Linuxppc-embedded
mailing list