IRQ共享原理

IRQ lines are a limited resource. A simple way to increase the number of devices a system can host is to allow multiple devices to share a common IRQ. Normally, each driver registers its own handler to the kernel for that IRQ. Instead of having the kernel receive the interrupt notification, find the right device, and invoke its handler, the kernel simply invokes all the handlers of those devices that registered for the same shared IRQ. It is up to the handlers to filter spurious invocations, such as by reading a registry on their devices.

 

--《Understanding Linux Network Internals》

 

当一个中断到来之后,内核会“唤醒”所有该中断的"订阅者",让他们各自查询自己的设备寄存器,以确定当前中断是不是自己的设备发出的。代价:每个订阅者都需要做一次查询。

因此,共享IRQ是需要付出代价的。对于慢速设备,这个代价可能很大。为了解决这一问题,这些设备可以将中断注册为不可共享的,其余“订阅者”想使用该中断的时候就会被拒绝。当然,这一方案并不治本,因为系统中断号总数量有限,不可能人人都注册成不可共享的形式。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值