+ -
当前位置:首页 → 问答吧 → 内核定时器与软中断

内核定时器与软中断

时间:2010-09-06

来源:互联网

ULKv3 上介绍run_timer_softirq 函数执行定时器中断,该函数执行的时候,会禁用本地中断。


QUOTE:
The run_timer_softirq( ) function is the deferrable function associated with the TIMER_SOFTIRQ softirq. It essentially performs the following actions:

Stores in the base local variable the address of the tvec_base_t data structure associated with the local CPU.

Acquires the base->lock spin lock and disables local interrupts.



那是否可以这样理解,如果我写的定时器函数在执行期间,本地CPU就不会再被其他事件所中断,软中断也不会产生?

作者: Godbach   发布时间: 2010-09-06

应该还是会被硬中断打断的,但是不会被软中断打断。

作者: ShadowStar   发布时间: 2010-09-06

看代码的确是这样,在遍历timer的时候,会调用spin_lock_irq。等到取得一个timer,在调用它的回调函数之前,才会unlock。或者就是等遍历完以后再unlock。
我想应该是因为中断的处理函数是可以add_timer什么的,所以这里不禁止中断还不行……

作者: kouu   发布时间: 2010-09-06

热门下载

更多