The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Con Kolivas <kernel@kolivas.org>
To: "lk" <linux_kernel@patni.com>
Cc: "jeff shia" <tshxiayu@gmail.com>,
	linux-kernel@vger.kernel.org, "robert love" <rml@novell.com>
Subject: Re: something about jiffies wraparound overflow
Date: Tue, 27 Dec 2005 20:05:21 +1100	[thread overview]
Message-ID: <200512272005.22440.kernel@kolivas.org> (raw)
In-Reply-To: <003201c60ac3$16692d90$5e91a8c0@patni.com>

On Tuesday 27 December 2005 19:54, lk wrote:
> As you mentioned the code for comparison:
> > /* code 2*/
> > unsigned long timeout = jiffies + HZ/2;
>
> the code has no problem with jiffies wrapping around
> as long as the values are compared in a right way.
> For a 32 bit platform the counter wraps around only once every 50 day
> when the value of HZ 1000. so if your code is prepared to face this event
> it will work fine.

In 2.6 we actually roll over 5 minutes after starting (the jiffy counter is 
set to about 5 minutes from roll over); that was put in on purpose to pick up 
wraparound bugs easily.

Cheers,
Con

  reply	other threads:[~2005-12-27  9:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-27  4:46 something about jiffies wraparound overflow jeff shia
2005-12-27  8:54 ` lk
2005-12-27  9:05   ` Con Kolivas [this message]
2005-12-27 14:54 ` Ben Collins
     [not found] <5oeWK-5Od-11@gated-at.bofh.it>
2005-12-27 10:06 ` Bodo Eggert

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=200512272005.22440.kernel@kolivas.org \
    --to=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_kernel@patni.com \
    --cc=rml@novell.com \
    --cc=tshxiayu@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox