public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [Bugme-new] [Bug 8479] New: gettimeofday returning 1000000 in tv_usec on core2duo
       [not found] <200705150417.l4F4HlvS013354@fire-2.osdl.org>
@ 2007-05-15  5:09 ` Andrew Morton
  2007-05-15  6:06   ` Eric Dumazet
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2007-05-15  5:09 UTC (permalink / raw)
  To: Thomas Gleixner, john stultz
  Cc: linux-kernel, bugme-daemon@kernel-bugs.osdl.org, dang

On Mon, 14 May 2007 21:17:47 -0700 bugme-daemon@bugzilla.kernel.org wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=8479
> 
>            Summary: gettimeofday returning 1000000 in tv_usec on core2duo
>     Kernel Version: 2.6.21
>             Status: NEW
>           Severity: normal
>              Owner: ak@suse.de
>          Submitter: dang@gentoo.org
> 
> 
> Most recent kernel where this bug did *NOT* occur: 2.6.20
> Distribution: Gentoo
> Hardware Environment: core2duo T7200 (all reporters had this same CPU)
> Software Environment: Linux 2.6.21, glibc 2.5
> Problem Description:
> 
> gettimeofday returns 1 - 1000000 in tv_usec, not 0 - 999999 
> This does not happen on any of my AMD-based 32 or 64 bit boxes, only on my
> core2duo; I have 2 other reports of this problem, all on T7200's
> 
> Steps to reproduce:
> 
> call gettimeofday a lot.  Eventually, you'll get 1000000 returned in tv_usec. My
> average is ~1 in 1000000 calls.  I've attached my test program, with output from
> various boxes.  One of the other reporters tried the test program too, and got
> similar output.  .config will be attached too.

err, whoops.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bugme-new] [Bug 8479] New: gettimeofday returning 1000000 in tv_usec on core2duo
  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
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Dumazet @ 2007-05-15  6:06 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Thomas Gleixner, john stultz, linux-kernel,
	bugme-daemon@kernel-bugs.osdl.org, dang, Andi Kleen

Andrew Morton a écrit :
> On Mon, 14 May 2007 21:17:47 -0700 bugme-daemon@bugzilla.kernel.org wrote:
> 
>> http://bugzilla.kernel.org/show_bug.cgi?id=8479
>>
>>            Summary: gettimeofday returning 1000000 in tv_usec on core2duo
>>     Kernel Version: 2.6.21
>>             Status: NEW
>>           Severity: normal
>>              Owner: ak@suse.de
>>          Submitter: dang@gentoo.org
>>
>>
>> Most recent kernel where this bug did *NOT* occur: 2.6.20
>> Distribution: Gentoo
>> Hardware Environment: core2duo T7200 (all reporters had this same CPU)
>> Software Environment: Linux 2.6.21, glibc 2.5
>> Problem Description:
>>
>> gettimeofday returns 1 - 1000000 in tv_usec, not 0 - 999999 
>> This does not happen on any of my AMD-based 32 or 64 bit boxes, only on my
>> core2duo; I have 2 other reports of this problem, all on T7200's
>>
>> Steps to reproduce:
>>
>> call gettimeofday a lot.  Eventually, you'll get 1000000 returned in tv_usec. My
>> average is ~1 in 1000000 calls.  I've attached my test program, with output from
>> various boxes.  One of the other reporters tried the test program too, and got
>> similar output.  .config will be attached too.
> 
> err, whoops.

I remember I already hit this and corrected it

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blobdiff;f=arch/x86_64/kernel/vsyscall.c;h=dc32cef961950915fbaa185e36ab802d5f7cea3b;hp=ba330f87067996a17495f7d03466d646c718b52c;hb=c8118c6c07f2edfd697aaa0b93e08c3b65a5a675;hpb=272a3713bb9e302e0455c894c41180a482d2c8a3

Maybe a stable push is necessary ?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bugme-new] [Bug 8479] New: gettimeofday returning 1000000 in tv_usec on core2duo
  2007-05-15  6:06   ` Eric Dumazet
@ 2007-05-15  6:23     ` Andrew Morton
  2007-05-15  7:22       ` Andi Kleen
  2007-05-19 14:30       ` Bill Davidsen
  0 siblings, 2 replies; 8+ messages in thread
From: Andrew Morton @ 2007-05-15  6:23 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Thomas Gleixner, john stultz, linux-kernel,
	bugme-daemon@kernel-bugs.osdl.org, dang, Andi Kleen, stable

On Tue, 15 May 2007 08:06:52 +0200 Eric Dumazet <dada1@cosmosbay.com> wrote:

> Andrew Morton a écrit :
> > On Mon, 14 May 2007 21:17:47 -0700 bugme-daemon@bugzilla.kernel.org wrote:
> > 
> >> http://bugzilla.kernel.org/show_bug.cgi?id=8479
> >>
> >>            Summary: gettimeofday returning 1000000 in tv_usec on core2duo
> >>     Kernel Version: 2.6.21
> >>             Status: NEW
> >>           Severity: normal
> >>              Owner: ak@suse.de
> >>          Submitter: dang@gentoo.org
> >>
> >>
> >> Most recent kernel where this bug did *NOT* occur: 2.6.20
> >> Distribution: Gentoo
> >> Hardware Environment: core2duo T7200 (all reporters had this same CPU)
> >> Software Environment: Linux 2.6.21, glibc 2.5
> >> Problem Description:
> >>
> >> gettimeofday returns 1 - 1000000 in tv_usec, not 0 - 999999 
> >> This does not happen on any of my AMD-based 32 or 64 bit boxes, only on my
> >> core2duo; I have 2 other reports of this problem, all on T7200's
> >>
> >> Steps to reproduce:
> >>
> >> call gettimeofday a lot.  Eventually, you'll get 1000000 returned in tv_usec. My
> >> average is ~1 in 1000000 calls.  I've attached my test program, with output from
> >> various boxes.  One of the other reporters tried the test program too, and got
> >> similar output.  .config will be attached too.
> > 
> > err, whoops.
> 
> I remember I already hit this and corrected it
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blobdiff;f=arch/x86_64/kernel/vsyscall.c;h=dc32cef961950915fbaa185e36ab802d5f7cea3b;hp=ba330f87067996a17495f7d03466d646c718b52c;hb=c8118c6c07f2edfd697aaa0b93e08c3b65a5a675;hpb=272a3713bb9e302e0455c894c41180a482d2c8a3

Oh, OK.

> Maybe a stable push is necessary ?

yup.  Please always think of -stable when preparing fixes.  I'm sure many
useful fixes are slipping past simply because those who _are_ looking out
for backportable fixes are missing things.

Greg, Chris: please consider c8118c6c07f2edfd697aaa0b93e08c3b65a5a675
for -stable, if it isn't already there.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bugme-new] [Bug 8479] New: gettimeofday returning 1000000 in tv_usec on core2duo
  2007-05-15  6:23     ` Andrew Morton
@ 2007-05-15  7:22       ` Andi Kleen
  2007-05-15  8:17         ` Eric Dumazet
  2007-05-19 14:30       ` Bill Davidsen
  1 sibling, 1 reply; 8+ messages in thread
From: Andi Kleen @ 2007-05-15  7:22 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Eric Dumazet, Thomas Gleixner, john stultz, linux-kernel,
	bugme-daemon@kernel-bugs.osdl.org, dang, stable


> >
> > I remember I already hit this and corrected it
> >
> > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blobdi
> >ff;f=arch/x86_64/kernel/vsyscall.c;h=dc32cef961950915fbaa185e36ab802d5f7ce
> >a3b;hp=ba330f87067996a17495f7d03466d646c718b52c;hb=c8118c6c07f2edfd697aaa0
> >b93e08c3b65a5a675;hpb=272a3713bb9e302e0455c894c41180a482d2c8a3
>
> Oh, OK.
>
> > Maybe a stable push is necessary ?
>
> yup.  Please always think of -stable when preparing fixes.  I'm sure many
> useful fixes are slipping past simply because those who _are_ looking out
> for backportable fixes are missing things.
>
> Greg, Chris: please consider c8118c6c07f2edfd697aaa0b93e08c3b65a5a675
> for -stable, if it isn't already there.

The full patch is overkill because 99% of it is an totally unrelated 
optimization. Only the > -> >= change should be backported

-Andi


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bugme-new] [Bug 8479] New: gettimeofday returning 1000000 in tv_usec on core2duo
  2007-05-15  7:22       ` Andi Kleen
@ 2007-05-15  8:17         ` Eric Dumazet
  2007-05-15 14:55           ` Daniel Gryniewicz
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Dumazet @ 2007-05-15  8:17 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Andrew Morton, Thomas Gleixner, john stultz, linux-kernel,
	bugme-daemon@kernel-bugs.osdl.org, dang, stable

On Tue, 15 May 2007 09:22:47 +0200
Andi Kleen <ak@suse.de> wrote:

> 
> > >
> > > I remember I already hit this and corrected it
> > >
> > > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blobdi
> > >ff;f=arch/x86_64/kernel/vsyscall.c;h=dc32cef961950915fbaa185e36ab802d5f7ce
> > >a3b;hp=ba330f87067996a17495f7d03466d646c718b52c;hb=c8118c6c07f2edfd697aaa0
> > >b93e08c3b65a5a675;hpb=272a3713bb9e302e0455c894c41180a482d2c8a3
> >
> > Oh, OK.
> >
> > > Maybe a stable push is necessary ?
> >
> > yup.  Please always think of -stable when preparing fixes.  I'm sure many
> > useful fixes are slipping past simply because those who _are_ looking out
> > for backportable fixes are missing things.
> >
> > Greg, Chris: please consider c8118c6c07f2edfd697aaa0b93e08c3b65a5a675
> > for -stable, if it isn't already there.
> 
> The full patch is overkill because 99% of it is an totally unrelated 
> optimization. Only the > -> >= change should be backported

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;
 	}

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bugme-new] [Bug 8479] New: gettimeofday returning 1000000 in tv_usec on core2duo
  2007-05-15  8:17         ` Eric Dumazet
@ 2007-05-15 14:55           ` Daniel Gryniewicz
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Gryniewicz @ 2007-05-15 14:55 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Andi Kleen, Andrew Morton, Thomas Gleixner, john stultz,
	linux-kernel, bugme-daemon@kernel-bugs.osdl.org, stable

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bugme-new] [Bug 8479] New: gettimeofday returning 1000000 in tv_usec on core2duo
  2007-05-15  6:23     ` Andrew Morton
  2007-05-15  7:22       ` Andi Kleen
@ 2007-05-19 14:30       ` Bill Davidsen
  2007-05-19 17:59         ` Eric Dumazet
  1 sibling, 1 reply; 8+ messages in thread
From: Bill Davidsen @ 2007-05-19 14:30 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Eric Dumazet, Thomas Gleixner, john stultz, linux-kernel,
	bugme-daemon@kernel-bugs.osdl.org, dang, Andi Kleen, stable

Andrew Morton wrote:
> On Tue, 15 May 2007 08:06:52 +0200 Eric Dumazet <dada1@cosmosbay.com> wrote:
> 
>> Andrew Morton a écrit :
>>> On Mon, 14 May 2007 21:17:47 -0700 bugme-daemon@bugzilla.kernel.org wrote:
>>>
>>>> http://bugzilla.kernel.org/show_bug.cgi?id=8479
>>>>
>>>>            Summary: gettimeofday returning 1000000 in tv_usec on core2duo
>>>>     Kernel Version: 2.6.21
>>>>             Status: NEW
>>>>           Severity: normal
>>>>              Owner: ak@suse.de
>>>>          Submitter: dang@gentoo.org
>>>>
>>>>
>>>> Most recent kernel where this bug did *NOT* occur: 2.6.20
>>>> Distribution: Gentoo
>>>> Hardware Environment: core2duo T7200 (all reporters had this same CPU)
>>>> Software Environment: Linux 2.6.21, glibc 2.5
>>>> Problem Description:
>>>>
>>>> gettimeofday returns 1 - 1000000 in tv_usec, not 0 - 999999 
>>>> This does not happen on any of my AMD-based 32 or 64 bit boxes, only on my
>>>> core2duo; I have 2 other reports of this problem, all on T7200's
>>>>
>>>> Steps to reproduce:
>>>>
>>>> call gettimeofday a lot.  Eventually, you'll get 1000000 returned in tv_usec. My
>>>> average is ~1 in 1000000 calls.  I've attached my test program, with output from
>>>> various boxes.  One of the other reporters tried the test program too, and got
>>>> similar output.  .config will be attached too.
>>> err, whoops.
>> I remember I already hit this and corrected it
>>
>> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blobdiff;f=arch/x86_64/kernel/vsyscall.c;h=dc32cef961950915fbaa185e36ab802d5f7cea3b;hp=ba330f87067996a17495f7d03466d646c718b52c;hb=c8118c6c07f2edfd697aaa0b93e08c3b65a5a675;hpb=272a3713bb9e302e0455c894c41180a482d2c8a3
> 
> Oh, OK.
> 
>> Maybe a stable push is necessary ?
> 
> yup.  Please always think of -stable when preparing fixes.  I'm sure many
> useful fixes are slipping past simply because those who _are_ looking out
> for backportable fixes are missing things.
> 
That makes me feel better, I have been occasionally suggesting fixes 
posted here as candidates for stable, I was afraid I was being a PITA. I 
forgot about the "stable" address and have been bugging greg, I'll stop 
that.

> Greg, Chris: please consider c8118c6c07f2edfd697aaa0b93e08c3b65a5a675
> for -stable, if it isn't already there.


-- 
Bill Davidsen <davidsen@tmr.com>
   "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bugme-new] [Bug 8479] New: gettimeofday returning 1000000 in tv_usec on core2duo
  2007-05-19 14:30       ` Bill Davidsen
@ 2007-05-19 17:59         ` Eric Dumazet
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Dumazet @ 2007-05-19 17:59 UTC (permalink / raw)
  To: Bill Davidsen
  Cc: Andrew Morton, Thomas Gleixner, john stultz, linux-kernel,
	bugme-daemon@kernel-bugs.osdl.org, dang, Andi Kleen, stable

Bill Davidsen a écrit :
> Andrew Morton wrote:
>> On Tue, 15 May 2007 08:06:52 +0200 Eric Dumazet <dada1@cosmosbay.com> 
>> wrote:
>>
>>> Andrew Morton a écrit :
>>>> On Mon, 14 May 2007 21:17:47 -0700 bugme-daemon@bugzilla.kernel.org 
>>>> wrote:
>>>>
>>>>> http://bugzilla.kernel.org/show_bug.cgi?id=8479
>>>>>
>>>>>            Summary: gettimeofday returning 1000000 in tv_usec on 
>>>>> core2duo
>>>>>     Kernel Version: 2.6.21
>>>>>             Status: NEW
>>>>>           Severity: normal
>>>>>              Owner: ak@suse.de
>>>>>          Submitter: dang@gentoo.org
>>>>>
>>>>>
>>>>> Most recent kernel where this bug did *NOT* occur: 2.6.20
>>>>> Distribution: Gentoo
>>>>> Hardware Environment: core2duo T7200 (all reporters had this same CPU)
>>>>> Software Environment: Linux 2.6.21, glibc 2.5
>>>>> Problem Description:
>>>>>
>>>>> gettimeofday returns 1 - 1000000 in tv_usec, not 0 - 999999 This 
>>>>> does not happen on any of my AMD-based 32 or 64 bit boxes, only on my
>>>>> core2duo; I have 2 other reports of this problem, all on T7200's
>>>>>
>>>>> Steps to reproduce:
>>>>>
>>>>> call gettimeofday a lot.  Eventually, you'll get 1000000 returned 
>>>>> in tv_usec. My
>>>>> average is ~1 in 1000000 calls.  I've attached my test program, 
>>>>> with output from
>>>>> various boxes.  One of the other reporters tried the test program 
>>>>> too, and got
>>>>> similar output.  .config will be attached too.
>>>> err, whoops.
>>> I remember I already hit this and corrected it
>>>
>>> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blobdiff;f=arch/x86_64/kernel/vsyscall.c;h=dc32cef961950915fbaa185e36ab802d5f7cea3b;hp=ba330f87067996a17495f7d03466d646c718b52c;hb=c8118c6c07f2edfd697aaa0b93e08c3b65a5a675;hpb=272a3713bb9e302e0455c894c41180a482d2c8a3 
>>>
>>
>> Oh, OK.
>>
>>> Maybe a stable push is necessary ?
>>
>> yup.  Please always think of -stable when preparing fixes.  I'm sure many
>> useful fixes are slipping past simply because those who _are_ looking out
>> for backportable fixes are missing things.
>>
> That makes me feel better, I have been occasionally suggesting fixes 
> posted here as candidates for stable, I was afraid I was being a PITA. I 
> forgot about the "stable" address and have been bugging greg, I'll stop 
> that.

Well, it seems Andrew concern about 'stable' was not right for this particular 
patch, since I  posted it well before 2.6.21-final, and 2.6.20 was not concerned.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-05-19 18:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
2007-05-19 14:30       ` Bill Davidsen
2007-05-19 17:59         ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox