From: Daniel Gryniewicz <dang@gentoo.org>
To: Eric Dumazet <dada1@cosmosbay.com>
Cc: Andi Kleen <ak@suse.de>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
john stultz <johnstul@us.ibm.com>,
linux-kernel@vger.kernel.org,
"bugme-daemon@kernel-bugs.osdl.org"
<bugme-daemon@bugzilla.kernel.org>,
stable@kernel.org
Subject: Re: [Bugme-new] [Bug 8479] New: gettimeofday returning 1000000 in tv_usec on core2duo
Date: Tue, 15 May 2007 10:55:51 -0400 [thread overview]
Message-ID: <1179240951.7903.0.camel@athena.fprintf.net> (raw)
In-Reply-To: <20070515101758.51d6bc47.dada1@cosmosbay.com>
On Tue, 2007-05-15 at 10:17 +0200, Eric Dumazet wrote:
> OK, here is the fix only patch, for linux-2.6.21-stable only, since 2.6.22 is already fixed.
>
> [PATCH] x86_64 : Fix vgettimeofday()
>
> vgettimeofday() may return some bad timeval values, (tv_usec = 1000000), because of a wrong compare.
>
> Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
>
> --- arch/x86_64/kernel/vsyscall.c
> +++ arch/x86_64/kernel/vsyscall.c
> @@ -132,7 +132,7 @@ static __always_inline void do_vgettimeo
>
> /* convert to usecs and add to timespec: */
> tv->tv_usec += nsec_delta / NSEC_PER_USEC;
> - while (tv->tv_usec > USEC_PER_SEC) {
> + while (tv->tv_usec >= USEC_PER_SEC) {
> tv->tv_sec += 1;
> tv->tv_usec -= USEC_PER_SEC;
> }
That fixed it, thanks.
Daniel
next prev parent reply other threads:[~2007-05-15 15:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200705150417.l4F4HlvS013354@fire-2.osdl.org>
2007-05-15 5:09 ` [Bugme-new] [Bug 8479] New: gettimeofday returning 1000000 in tv_usec on core2duo Andrew Morton
2007-05-15 6:06 ` Eric Dumazet
2007-05-15 6:23 ` Andrew Morton
2007-05-15 7:22 ` Andi Kleen
2007-05-15 8:17 ` Eric Dumazet
2007-05-15 14:55 ` Daniel Gryniewicz [this message]
2007-05-19 14:30 ` Bill Davidsen
2007-05-19 17:59 ` Eric Dumazet
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=1179240951.7903.0.camel@athena.fprintf.net \
--to=dang@gentoo.org \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=bugme-daemon@bugzilla.kernel.org \
--cc=dada1@cosmosbay.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@kernel.org \
--cc=tglx@linutronix.de \
/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