[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
A query about jiffies
Hi:
I have the following queries related to jiffies:
1) At the time of boot up is jiffies = 0 or does it start at a value > 0?
2) If HZ = 1000 as it is in the 2.6 kernel, would it be *safe* for one to
use the following code snippet in schedule() defined in kernel/sched.c:
/* Forget about jiffy wrap around for now */
unsigned long j = jiffies;
if(j >= 120 * HZ && j <= 121 * HZ)
printk(KERN_NOTICE "The jiffies at the 120 second: %lu \n", j);
That is the parameter to printk must be 'printed' at everytime schedule
is invoked between the 120th and 121st second after boot up.
But unfortunately this does not seem to work. The if branch is _not_
taken. What could be the problem? Any help will be appreciated.
3) As an aside, a printk inside schedule() defined in kernel/sched.c as
shown below shows something unexpected:
unsigned long j = jiffies;
printk(KERN_NOTICE "Jiffies %lu: \n", j);
logs the following in /var/log/messages
...
blah blah ... Jiffies: 4294667652
...
Isn't this unexpected/junk? Or have I done something wrong.
Again, any help will be appreciated.
Thanks in advance
Hareesh Nagarajan
Bangalore, India
WEB: http://puggy.symonds.net/~hareesh
--
http://www.fastmail.fm - And now for something completely different?
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/