目录
前言
高精度定时器,为我们提供了纳秒级别的定时精度,以满足对精确时间有迫切需求的内核驱动。hrtimer通过可编程定时器来现,在等待时,不占用CPU资源;
一、什么是高精度定时器
内核从2.6.xx开始加入了高精度定时器hrtimer,它可以为我们提供纳秒级别的定时精度,以满足对精确时间有迫切需求的内核驱动;高精度定时器它类似于一种“软件中断”,定时时间超时会触发回调函数;
二、高精度定时器知识点
1、hrtimer结构体
路径:kernel/include/linux/hrtimer.h
/**
* struct hrtimer - the basic hrtimer structure
* @node: timerqueue node, which also manages node.expires,
* the absolute expiry time in the hrtimers internal
* representation. The time is related to the clock on
* which the timer is based. Is setup by adding
* slack to the _softexpires value. Fo