md.jamal
md.jamal

Reputation: 4517

INITIAL_JIFFIES value on boot

I have read that on boot, jiffies is not initialized to zero, it is initialized to INITIAL_JIFFIES constant

From header file

  /*
   * Have the 32 bit jiffies value wrap 5 minutes after boot
   * so jiffies wrap bugs show up earlier.
   */
   #define INITIAL_JIFFIES ((unsigned long)(unsigned int) (-300*HZ))

How -300*HZ wraps 5 minutes after boot. Can anyone please explain me?

Upvotes: 1

Views: 712

Answers (1)

user12822474
user12822474

Reputation: 66

HZ is the number of clock ticks (jiffies) in 1 second.

300 seconds is 5 minutes.

Therefore 300 x HZ is the number of jiffies in 5 minutes.

Therefore after 5 minutes, an initial value of -300 * HZ will have been incremented to 0.

Upvotes: 3

Related Questions