hi,
one of our customer is facing an issue with jiffies wrap up.
on a 32 bit machine, the variable jiffies count upto 472 days.
the customer's server was up for 472 days ('uptime') and to reproduce
the same, i tried to change the variable HZ in linux-2.6..23.9/include/asm-i386/param.h
from 100 to 10000.
after which i rebuilt the kernel with following steps:
# make oldconfig
# make modules_install
# make install
Now when i boot from this newly built kernel, i wrote a small kernel module
to read the jiffies and HZ global variable,which is as follows:
[root@localhost drivers]# cat get_jiffies.c
#include <linux/init.h>
#include <linux/module.h>
#include <asm/current.h>
#include <linux/sched.h>
#include <linux/time.h>
#include <linux/jiffies.h>
static int __init jiffies_init(void)
{
unsigned long j,z;
j = z = 0;
j = jiffies;
z = HZ;
printk(KERN_ALERT "jiffies value is %lu\n",j);
printk(KERN_ALERT "jiffies value in seconds %lu\n",(jiffies/HZ));
printk(KERN_ALERT "HZ value is %lu\n",z);
return 0;
}
static void __exit jiffies_exit(void)
{
printk(KERN_ALERT "Goodbye, world!\n");
}
module_init(jiffies_init);
module_exit(jiffies_exit);
MODULE_LICENSE("GPL");
[root@localhost drivers]# insmod get_jiffies.ko
[root@localhost drivers]# dmesg
jiffies value is 372939
jiffies value in seconds 1491
HZ value is 250 <====
why this HZ variable is shown as 250 ?
i am a newbie in kernel programming and i might be doing something really stupid as well.
~amit