timerqueue_node用于表示一个hrtimer节点,它在标准红黑树节点rb_node的基础上增加了expires字段,该字段和hrtimer中的_softexpires字段一起,设定了hrtimer的到期时间的一个范围,hrtimer可以在hrtimer._softexpires至timerqueue_node.expires之间的任何时刻到期,我们也称timerqueue_node.expires为硬过期时间(hard),意思很明显:...
timerqueue_node用于表示一个hrtimer节点,它在标准红黑树节点rb_node的基础上增加了expires字段,该字段和hrtimer中的_softexpires字段一起,设定了hrtimer的到期时间的一个范围,hrtimer可以在hrtimer._softexpires至timerqueue_node.expires之间的任何时刻到期,我们也称timerqueue_node.expires为硬过期时间(hard),意思很明显:...
if (!ktime_before(now, cpu_base->softirq_expires_next)) { /* 将下个到期的软超时间设置为最大值,这算是默认值,等待hrtimer软中断处理函数重新更新下一个即将超时的软timer的过期时间*/ cpu_base->softirq_expires_next = KTIME_MAX; /* 设置softirq_activated表示已经激活了本CPU的hrtimer软中断 */ c...
-MACHINE_START -.timer=&v8timer -.init=v8timer_init -v8timer_clockevent_init() -setup_irq(IRQ_TIMER1,&v8timer_irq) -v8timer_irq.handler=v8timer_interrupt, -v8timer_interrupt() -evt->event_handler() -hrtimer_switch_to_hres -tick_init_highres -tick_switch_to_oneshot(hrtimer_interrup...
return timer->node.expires; } 所以,取的实际上是定时器的“硬”到期时间,后面可以看到在处理到期定时器时,使用的是“软”到期时间,两者有时间差。 3.7 对定时事件设备重编程 hrtimer_reprogram 前面分析高分辨率定时器激活代码的时候提到过,hrtimer_start_range_ns 函数在将定时器成功插入了对应的红黑树后会调用...
struct hrtimer {struct timerqueue_node node;ktime_t _softexpires;enum hrtimer_restart (*function)(struct hrtimer *);struct hrtimer_clock_base *base;unsigned long state;...};enum hrtimer_restart {HRTIMER_NORESTART, /* Timer is not restarted */HRTIMER_RESTART, /* Timer must be restarted...
hrtimer_set_expires(&ts->sched_timer, tick_init_jiffy_update()); for (;;) { hrtimer_forward(&ts->sched_timer, now, tick_period); hrtimer_start_expires(&ts->sched_timer, HRTIMER_MODE_ABS_PINNED); /* Check, if the timer was already in the past */ ...
hrtimer_start_expires(&t->timer, mode); if (!hrtimer_active(&t->timer)) t->task = NULL; if (likely(t->task)) schedule(); hrtimer_cancel(&t->timer); mode = HRTIMER_MODE_ABS; } while (t->task && !signal_pending(current)); ...
hrtimer_start_expires(&t->timer, mode); if (!hrtimer_active(&t->timer)) t->task = NULL; if (likely(t->task)) schedule(); hrtimer_cancel(&t->timer); mode = HRTIMER_MODE_ABS; }while (t->task && !signal_pending(current)); ...
由hrtimer_init()初始化 */ struct hrtimer { struct timerqueue_node node; ktime_t _softexpires; enum hrtimer_restart (*function)(struct hrtimer *); struct hrtimer_clock_base *base; u8 state; u8 is_rel; #ifdef CONFIG_TIMER_STATS int start_pid; void *start_site; char start_comm[16]; ...