mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Rumpf <prumpf@parcelfarce.linux.theplanet.co.uk>
To: Jeff Garzik <jgarzik@mandrakesoft.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: jiffies wrap question...
Date: Fri, 10 Nov 2000 07:35:29 +0000	[thread overview]
Message-ID: <20001110073529.K2272@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <3A0BA1F8.E3ABCD18@mandrakesoft.com>
In-Reply-To: <3A0BA1F8.E3ABCD18@mandrakesoft.com>; from jgarzik@mandrakesoft.com on Fri, Nov 10, 2000 at 02:21:28AM -0500

On Fri, Nov 10, 2000 at 02:21:28AM -0500, Jeff Garzik wrote:
> The following is a piece of code from the latter half of
> schedule_timeout, in kernel/sched.c.  Is it possible that
> schedule_timeout could return an incorrect value, if the jiffy value
> wraps between the first and last lines shown below.

let's say the first line happens n ticks before the wrap and the second,
m ticks afterwards.

>         expire = timeout + jiffies;

expire = timeout + 2^32/2^64 - n = timeout - n

>         timeout = expire - jiffies;

timeout = expire - m = timeout - n - m = timeout - (n+m)

(n+m) is the time that actually passed while we were asleep, and timeout
has the correct value (timeout - ticks that happened)>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

      reply	other threads:[~2000-11-10  7:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-10  7:21 Jeff Garzik
2000-11-10  7:35 ` Philipp Rumpf [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=20001110073529.K2272@parcelfarce.linux.theplanet.co.uk \
    --to=prumpf@parcelfarce.linux.theplanet.co.uk \
    --cc=jgarzik@mandrakesoft.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®