LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   jiffies value in 2.4 and 2.6 kernels (https://www.linuxquestions.org/questions/linux-kernel-70/jiffies-value-in-2-4-and-2-6-kernels-736627/)

Bandlaraj 06-30-2009 03:52 AM

jiffies value in 2.4 and 2.6 kernels
 
Hi Folks,

I just came to know that jiffies intialised to -5 minutes in 2.6 kernels,whereas it was zero, basically it will report the uptime from last boot.

1.Why this has been changed to -5 minutes in 2.6?
2.If the application is written using 2.4 kernels using the times,then wht are all the things we need to consider before porting it to 2.6 kernels.
3. Also i see that do_div is returning the rem,that means it always returns
one of the values from the range 0-base,this is wht we intended for?

If there are any previous posts related to this,please point me them.
Please let me know.

Thanks
bandlaraj

kuru 06-30-2009 10:06 AM

> 1.Why this has been changed to -5 minutes in 2.6?

It is for finding jiffies bug as soon as possibile.

If jiffies initialize to 0, it will overflow after about 50days(HZ=1000, 32bit integer jiffies). However if the jiffies sets to -300000, it will overflow after 5 minutes.
So, if you do not check the jiffies properly, you can find out the kernel bug just in 5 minutes. (The kernel provides some macros like time_after and time_before for handling wraparound)

Bandlaraj 07-01-2009 12:46 AM

Thanks Kuru!

Can anyone reply to other issues i have raised?

Thanks
bandlaraj


All times are GMT -5. The time now is 04:08 PM.