Linux Jiffy

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 ...

Jiffy是内核的时间单位,定义在linux/jiffies.h头文件。为了理解Jiffy,我们需要引入一个常量:HZ,HZ指的是在一秒内jiffy增加的次数。Jiffy的每一次增加称为一个tick。也就是说,HZ代表了一个jiffy尺度。HZ依赖于硬件、内核版本,用于决定中断发生的频率。HZ在某些架构下是可配置的,在其他架构下是固定值;

在一秒内,jiffy增加HZ次。例如,HZ=1000,那么一秒内jiffy增加1000次(也就是说,每1msjiffy增加一次)。可编程中断定时器PIT

Linux中断:Interrupts — The Linux Kernel documentation

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值