All of lore.kernel.org
 help / color / mirror / Atom feed
From: george anzinger <george@mvista.com>
To: Michael Arras <mkarras110@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix for sys_nanosleep() in 2.4.16
Date: Thu, 29 Nov 2001 15:41:39 -0800	[thread overview]
Message-ID: <3C06C7B3.A1DF4EAB@mvista.com> (raw)
In-Reply-To: <3C05DC1D.7071FC6B@yahoo.com>

Michael Arras wrote:
> 
> Greetings,
> 
> For many of us, the kernel thread scheduling resolution is
> 10ms (see getitimer(2)).  By adding 1 jiffy to the time to
> sleep in sys_nanosleep(), threads are sleeping 10ms too long.
> timespec_to_jiffies() does a good job at returning the
> appropriate number of jiffies to sleep.  There is no need to
> add one for good measure.
>
Not really.  It depends on where the call is made with respect to the
next jiffies interrupt.  The standard says that the call MUST not return
early, thus, on the chance that the current time is not exactly on a
jiffies edge, the one must be added.  The average sleep should be 1/HZ+
1/(2*HZ) or 15ms, but never less than 10ms.  For higher resolution stay
tuned to the high-res-timers project (see signature line).


-- 
George           george@mvista.com
High-res-timers: http://sourceforge.net/projects/high-res-timers/
Real time sched: http://sourceforge.net/projects/rtsched/

      parent reply	other threads:[~2001-11-29 23:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-29  6:56 [PATCH] Fix for sys_nanosleep() in 2.4.16 Michael Arras
2001-11-29 10:04 ` Christoph Hellwig
2001-11-29 23:41 ` george anzinger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C06C7B3.A1DF4EAB@mvista.com \
    --to=george@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkarras110@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.