Linux下半部分如何在中断上下文中执行? [英] How can the linux bottom halfs execute in interrupt context?

查看:315
本文介绍了Linux下半部分如何在中断上下文中执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在了解上半部分和下半部分的概念时,我来了 面对一个问题.

While understanding the concepts of top halves and bottom halves, I came across with a question.

这是我的理解: 上半部分和下半部分在中断上下文中执行.唯一的 区别在于下半部分在启用中断的同时执行 上半部分在禁用相应的irq的情况下执行(仍然可以 通过使用SA_INTERRUPT标志克服).

Here is my understanding: Top half and Bottom half executes in interrupt context. The only difference being that the Bottom half executes with interrupt enabled while the top half executes with the corresponding irq disabled(Which can still be overcome by using SA_INTERRUPT flag).

问题: 在上半部分处理程序返回之前,return_from_intr是 叫.现在,调用调度程序并执行下半部分(如果有的话) 有待处理的. 由于调用了return_from_intr,下半部分如何执行 中断上下文?它将处于内核模式而不是中断 模式?

The question: Just before return from the top half handler, return_from_intr is called. Now the scheduler is invoked and executes the bottom halves if there are any pending ones. Since return_from_intr is called, how can the bottom halves execute in interrupt context?. It will be in kernel mode rather than the interrupt mode?

如果我错了,请纠正我.

Please correct me if I am wrong.

推荐答案

下半部分不在中断上下文中执行,这是将中断处理分为两半并将较慢的代码移出ISR的全部要点.但是,它们仍处于内核环境中.例如,请参见本文.

Bottom halves aren't executed in the interrupt context, which is the entire point of splitting interrupt processing into two halves and moving slower code outside of the ISRs. They're still in the kernel context, though. See this article, for example.

这篇关于Linux下半部分如何在中断上下文中执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆