netdev
[Top] [All Lists]

Re: MSEC_TO_JIFFIES is messed up...

To: Ingo Molnar <mingo@xxxxxxx>
Subject: Re: MSEC_TO_JIFFIES is messed up...
From: Valdis.Kletnieks@xxxxxx
Date: Wed, 12 May 2004 15:47:18 -0400
Cc: Jeff Garzik <jgarzik@xxxxxxxxx>, Greg KH <greg@xxxxxxxxx>, Andrew Morton <akpm@xxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, Netdev <netdev@xxxxxxxxxxx>
In-reply-to: Your message of "Wed, 12 May 2004 21:33:49 +0200." <20040512193349.GA14936@xxxxxxx>
References: <20040512020700.6f6aa61f.akpm@xxxxxxxx> <20040512181903.GG13421@xxxxxxxxx> <40A26FFA.4030701@xxxxxxxxx> <20040512193349.GA14936@xxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Wed, 12 May 2004 21:33:49 +0200, Ingo Molnar said:
> 
> * Jeff Garzik <jgarzik@xxxxxxxxx> wrote:
> 
> > >Woah, that's new.  And wrong.  The code in include/asm-i386/param.h that
> > >says:
> > >   # define JIFFIES_TO_MSEC(x)     (x)
> > >   # define MSEC_TO_JIFFIES(x)     (x)
> > >
> > >Is not correct.  Look at kernel/sched.c for verification of this :)
> > 
> > 
> > Yes, that is _massively_ broken.
> 
> why is it wrong?

If the kernel jiffie is anything other than exactly 1 msec, you're screwed... 

[/usr/src/linux-2.6.6-mm1]2 find include -name '*.h' | xargs egrep '#define HZ '
include/asm-ppc64/param.h:#define HZ 100
include/asm-mips/param.h:#define HZ 100
include/asm-mips/mach-dec/param.h:#define HZ (1 << LOG_2_HZ)
include/asm-x86_64/param.h:#define HZ 100
include/asm-ppc/param.h:#define HZ 100
include/asm-m68k/param.h:#define HZ 100
include/asm-m68knommu/param.h:#define HZ 1000
include/asm-m68knommu/param.h:#define HZ 100
include/asm-m68knommu/param.h:#define HZ 100
include/asm-m68knommu/param.h:#define HZ 100
include/asm-m68knommu/param.h:#define HZ 100
include/asm-m68knommu/param.h:#define HZ 100
include/asm-m68knommu/param.h:#define HZ 100
include/asm-m68knommu/param.h:#define HZ 50
include/asm-m68knommu/param.h:#define HZ 100
include/asm-parisc/param.h:#define HZ 100
include/asm-um/param.h:#define HZ 100
include/asm-sparc/param.h:#define HZ 100
include/asm-s390/param.h:#define HZ 100
include/asm-i386/param.h:#define HZ 100
include/asm-h8300/param.h:#define HZ 100
include/asm-sparc64/param.h:#define HZ 100
include/asm-cris/param.h:#define HZ 100
include/asm-sh/param.h:#define HZ 100

Attachment: pgp800Gawk68g.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>