多核/多 CPU 机器中的中断如何工作? [英] How do interrupts in multicore/multicpu machines work?

查看:72
本文介绍了多核/多 CPU 机器中的中断如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始深入研究低级操作系统编程.我(非常缓慢)目前正在阅读两本较旧的书籍,XINU 和 Build Your Own 32 Bit OS,以及一些优秀的 SO 人在我之前的问题中建议的一些资源,如何开始操作系统开发.

I recently started diving into low level OS programming. I am (very slowly) currently working through two older books, XINU and Build Your Own 32 Bit OS, as well as some resources suggested by the fine SO folks in my previous question, How to get started in operating system development.

可能只是我还没有在这些资源中遇到过它,但这可能是因为这些资源中的大多数是在无处不在的多核系统之前编写的,但我想知道的是中断在多核中是如何工作的/多处理器系统.

It could just be that I haven't encountered it in any of those resources yet, but its probably because most of these resources were written before ubiquitous multicore systems, but what I'm wondering is how interrupts work in a multicore/multiprocessor system.

例如,假设 DMA 想要发出文件读取操作完成的信号.哪个处理器/内核确认已发出中断信号?是启动文件读取的处理器/内核吗?是哪个处理器/内核先得到它?

For instance, say the DMA wants to signal that a file read operation is complete. Which processor/core acknowledges that an interrupt was signaled? Is it the processor/core that initiated the file read? Is it whichever processor/core that gets to it first?

推荐答案

查看 IoConnectInterrupt 函数,您可以找到 ProcessorEnableMask,它将选择允许运行 InterruptService 例程 (ISR).
基于此信息,我可以假设处于低级别(请参阅 Adam's post) 可以指定中断路由的位置.

Looking into the IoConnectInterrupt function you can find the ProcessorEnableMask that will select the cpu's that allowed to run the InterruptService routine (ISR).
Based on this information i can assume that somewhere in the low level (see Adam's post) it's possible to specify where to route the interrupt.

附带说明文件操作与中断和/或 dma 没有直接关系.文件操作是文件系统概念,转换为低级别取决于文件系统所在的总线,它可能是 IDE 或 SATA 磁盘,甚至可能是 USB 存储,在这种情况下,扇区读取将被转换为 USB 总线上的 3 个逻辑操作,那里将由 USB 主机控制器驱动程序提供中断服务,但它与原始文件读取操作并没有真正的关系,这可能以任何方式拆分为较小的事务.

On the side note file operation is not really related to the interrupts and/or dma directly. File operation is file system concept that translated to something low level depend on which bus you filesystem located it might be IDE or SATA disk or it might be even usb storage in this case sector read will be translated to 3 logical operation over usb bus, there will be interrupt served by usb host controller driver, but it's not really related to original file read operation, that was probably split to smaller transaction any way.

这篇关于多核/多 CPU 机器中的中断如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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