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
On Wed, 12 May 2004 Valdis.Kletnieks@vt.edu wrote:
On Wed, 12 May 2004 21:33:49 +0200, Ingo Molnar said:
quoted
* 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...
I believe they were talking about include/asm-i386/param.h
^^^^^^^^
- Davide
Davide Libenzi wrote:
On Wed, 12 May 2004 Valdis.Kletnieks@vt.edu wrote:
quoted
On Wed, 12 May 2004 21:33:49 +0200, Ingo Molnar said:
quoted
* 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...
I believe they were talking about include/asm-i386/param.h
^^^^^^^^
There's sometimes a need to change HZ on i386 systems. Specifically,
some IDE drives are unable to safely use DMA (this is documented in one
of the Kconfig files). Without DMA for the IDE drives many systems
experience (a lot of) missed interrupts which can lead to (among other
things) lost ticks and very erratic and unpredictable behaviour from
input devices such as the mouse.
Also, if defined in terms of HZ only one definition of these macros
would be required rather than one for each architecture.
Peter
--
Dr Peter Williams, Chief Scientist peterw@aurema.com
Aurema Pty Limited Tel:+61 2 9698 2322
PO Box 305, Strawberry Hills NSW 2012, Australia Fax:+61 2 9699 9174
79 Myrtle Street, Chippendale NSW 2008, Australia http://www.aurema.com