David Fries 6ffc787a44 system timer: fix crash in <100Hz system timer
The kernel has a divide by zero crash when trying to run the system timer
less than 100Hz.  The problem is x/(HZ/USER_HZ) and related.  Now
x*(USER_HZ/HZ) will be used if HZ<USER_HZ.

I'm running the Linux kernel under qemu and went to run a slower system
timer to take less CPU (and battery) on the host.  I found that the kernel
paniced under emulation because of a divide by zero in three places.  Here
is the patch.  The base git was updated today 01-05-2008.  I went for a
20Hz system time by adding config HZ_20 etc to kernel/Kconfig.hz.  With
this patch I verified the system timer by looking at /proc/interrupts.

[akpm@linux-foundation.org: partially clean up the macro maze]
Signed-off-by: David Fries <david@fries.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06 10:41:10 -08:00
..
2008-02-03 17:07:16 +02:00
2008-02-06 10:41:01 -08:00
2008-02-06 10:41:01 -08:00
2008-02-06 10:41:01 -08:00
2008-02-06 10:41:01 -08:00
2008-02-06 10:41:02 -08:00
2008-02-06 10:41:00 -08:00
2008-02-06 10:41:02 -08:00
2008-02-05 09:44:31 -08:00
2008-02-06 10:41:01 -08:00
2007-08-18 17:15:17 -07:00
2008-02-03 17:19:47 +02:00
2008-02-03 17:47:00 +02:00
2008-01-31 17:40:18 +01:00