How the ubuntu handle the jiffies wrap around problem?
After my embedded linux system boot up, the 64bits jiffies returned by
# include <s开发者_运维技巧ys/times.h>
long long unsigned int tmpJiffies = times(NULL);
printf("the tmpJiffies is 0x%llx.\n", tmpJiffies);
will be 0xffff ffff ffff b22b.
And after 5 minutes the return value will wrap around to zero and keep increasing.
I found in the source of linux kernel \include\linux\jiffies.h there is code like this:
/*
* 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))
That is why the jiffies wrap around after 5 minutes since system bootup.
But when I try it on my ubuntu linux machine, the jiffies returned value is different. It is start from 0x6667bf66.
I want to know how can ubuntu do this?
精彩评论