哪个处理器将在muticore系统中执行硬件中断 [英] Which processor would execute hardware interrupt in a muticore system

查看:87
本文介绍了哪个处理器将在muticore系统中执行硬件中断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,至少需要立即处理硬件中断,以便对其进行确认并进行一些第一级处理.据我了解,这不是预定的活动.请纠正我.

In general hardware interrupts need to be processed immediately, at least so as to acknowledge it and do some first level of processing. As I understand this is not scheduled activity. Please correct me.

所以问题是如何选择将实际执行此硬件中断处理程序的处理器?

So the question is how to choose a processor that would actually execute this hardware interrupt handler?

对于Linux和/或BSD系统,人们可以回答这个问题

One can answer this for Linux and/or BSD systems

推荐答案

通常,这取决于多核处理器和OS提供的功能.使用多核处理器时,您可能需要根据需要配置中断的相似性.

In general, this depends on the functionality offered by multi-core processor and OS. While using multi-core processors, you might need to configure the affinity of the interrupt as per your requirement.

对于linux/proc文件系统具有显示/配置中断相关性的功能.

In the case of linux, the /proc file system has provision to show/configure the affinity of interrupts.

1)相应irq的文件smp_affinity保留一个位掩码,可用于配置要由多核系统中的相应内核服务的irq:

1) The file smp_affinity for respective irq holds a bitmask which can be used for configuring the irq to be serviced by respective core in multi-core system :

/proc/irq/'irq_number'/smp_affinity

/proc/irq/'irq_number'/smp_affinity

echo 2 > /proc/irq/12/smp_affinity  -> Configures the affinity of IRQ 12 to CPU 1
echo 4 > /proc/irq/14/smp_affinity  -> Configures the affinity of IRQ 14 to CPU 2

2)文件smp_affinity_list通过避免使用位掩码配置内核的方法来帮助为特定的IRQ配置CPU范围:

2) The file smp_affinity_list helps in configuring a range of CPU for a particular IRQ by avoiding the method of bitmask to configure the cores :

/proc/irq/'irq_number'/smp_affinity_list

/proc/irq/'irq_number'/smp_affinity_list

cat /proc/irq/12/smp_affinity_list -> Configures the affinity of IRQ 12 to CPU cores 0 to 3

3)linux还提供了一个名为irqbalance的中断负载平衡守护程序,该守护程序可以帮助在处理器内核之间分配中断,以优化性能.在某些系统中,该守护程序可能默认情况下处于启用状态,因此,如果要手动配置中断的亲和力,则应禁用此守护程序,否则每次重置后,它可能会覆盖配置的亲和力.

3) Also linux offers a interrupts load balancing daemon called irqbalance which can help in distribution of interrupts across processor cores to optimize performance. This daemon may be enabled by default in certain system and hence this should be disabled if you want the manually configure the affinity of interrupt else this might override the configured affinity after every reset.

这篇关于哪个处理器将在muticore系统中执行硬件中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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