Can jiffies freeze?

Mulyadi Santosa mulyadi.santosa at gmail.com
Wed Jan 23 10:42:29 EST 2013


On Wed, Jan 23, 2013 at 1:36 AM, sandeep kumar
<coolsandyforyou at gmail.com> wrote:
> Dear Anish, Mulyadi,
>
> this is how i read jiffies.
>
> unsigned long start_time, end_time;
> start_time = jiffies;
> free_area(***);
> end_time = jiffies;
> printk("%ld", end_time-start_time);
>
> I onserved jiffies getting incremented at different place, though

and where exactly do you put that code?

Theoritically, it is possible that you put such code in interrupt
disabled code path, thus you see no jiffies increment. Another
possibility is that code (retrieving jiffies for both start_time and
end_time) ends faster than 1/HZ second, thus jiffies hasn't
incremented yet.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com



More information about the Kernelnewbies mailing list