Jiffies and HZ

A jiffy is a kernel unit of time declared in <linux/jiffies.h>. To understand jiffies, we need to introduce a new constant, HZ, which is the number of times jiffies is incremented in one second. Each increment is called a tick. In other words, HZ represents the size of a jiffy. HZ depends on the hardware and on the kernel  version, and also determines how frequently the clock interrupt fires. This is configurable on some architectures, fixed on other ones.

What it means is that jiffies is incremented HZ times every second. If HZ = 1,000, then it is incremented 1,000 times (that is, one tick every 1/1,000 seconds). Once defined, the programmable interrupt timer (PIT), which is a hardware component, is programmed with that value ...

Get Linux Device Drivers Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.