mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roman Zippel <zippel@linux-m68k.org>
To: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
Cc: john stultz <johnstul@us.ibm.com>,
	lkml <linux-kernel@vger.kernel.org>,
	alex.shi@intel.com, Thomas Gleixner <tglx@tglx.de>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC][PATCH] Catch xtime_nsec underflows and fix them
Date: Wed, 3 Dec 2008 17:09:07 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.64.0812031701210.24668@localhost.localdomain> (raw)
In-Reply-To: <1228279532.2866.192.camel@ymzhang>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 811 bytes --]

Hi,

On Wed, 3 Dec 2008, Zhang, Yanmin wrote:

> > > When xtime_nsec underflows at the first time, xtime.tv_nsec becomes -1.
> > > Later on when the second tick arrives, below statement in the while loop
> > >  clock->xtime_nsec += clock->xtime_interval;
> > > will cause clock->xtime_nsec becomes positive again. So the second tick
> > > appears a going-backward time.
> > 
> > Yes, but only by 1nsec, so normally it wouldn't be noticable.
> Not 1nsec. At the second tick, go back about 4294967296 nsec (2^32), about
> 4 seconds. That matches the output of testing process.

Above code is not the problem. The error appeared in do_vgettimeofday() as 
it only uses unsigned values, so the -1 became 0xffffffff in nsec and the 
clock jumped forward 4 seconds and a tick later 4 seconds back.

bye, Roman

  reply	other threads:[~2008-12-03 16:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02  2:34 john stultz
2008-12-03  2:35 ` Roman Zippel
2008-12-03  3:01   ` Zhang, Yanmin
2008-12-03  3:48     ` Roman Zippel
2008-12-03  4:45       ` Zhang, Yanmin
2008-12-03 16:09         ` Roman Zippel [this message]
2008-12-04 21:19   ` john stultz

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=Pine.LNX.4.64.0812031701210.24668@localhost.localdomain \
    --to=zippel@linux-m68k.org \
    --cc=akpm@linux-foundation.org \
    --cc=alex.shi@intel.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@tglx.de \
    --cc=yanmin_zhang@linux.intel.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

all inboxes | Powered by JetHome®