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
.. True. The problem is that even for the i386 family, there's no inherent reason why the value of HZ is nailed to 1000 - it was changed from the default 100 in the 2.4 kernel for reasons that apply
That should read we "know" that HZ is 1000.... How about this instead? That will DTRT if somebody changes HZ for their build, and still allow us to avoud the *1000/1000 conversion for most builds....
Yes, that's a correct optimisation. This is simply a namespace clash. How about we do: in some kernel-wide header then kill off all the private implementations?
new patch attached - this adopts the overflow-safe variant from sctp.h, removes it from sctp.h and moves it into a generic include file and also does the HZ=1000 simplification. Ingo Attachment: hz-c
Yes, that was Sridhar Samudrala <sri@xxxxxxxxxx>. I've done some work to create an accurate implementation of msecs_to_jiffies() and jiffies_to_msecs(), which I was going to submit later this week a
The code is 100% correct, but not 100% clean, and definitely not documented. The reason for the change was to avoid unnecessary integer multiplications and divisions in sched.c. the attached patch (a
yet another patch - this time it's: complete, covers irda, accelerates HZ=100, unifies the slightly differing namespaces and compiles/boots as well. Ingo Attachment: hz-cleanup-2.6.6-A2 Description:
Author: William Lee Irwin III <wli@xxxxxxxxxxxxxx>
Date: Wed, 12 May 2004 13:59:15 -0700
Yes. Changelog: Optimize the cases where HZ is a divisor of 1000 or vice-versa in JIFFIES_TO_MSEC() and MSEC_TO_JIFFIES() by allowing the nonvanishing(!) integral ratios to appear as a parenthesized
I have submitted a patch just to do this some time back on netdev mailing list. You can find it at http://marc.theaimsgroup.com/?l=linux-netdev&m=108024598716537&w=2 static inline unsigned long msecs