Thread (3 messages) flat view 3 messages, 3 authors, 2004-05-12

Re: MSEC_TO_JIFFIES is messed up...

From: <hidden>
Date: 2004-05-12 19:50:15
Also in: lkml

On Wed, 12 May 2004 21:33:49 +0200, Ingo Molnar said:
* Jeff Garzik [off-list ref] wrote:
quoted
quoted
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

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help