How to give highest priority to ethernet interrupt in linux

自古美人都是妖i 提交于 2019-12-05 01:24:01

问题


I listed all interrupts with this:

cat /proc/interruts

it gives this:

        CPU0        CPU1         CPU2        CPU3
    0:   126           0            0           0     IO-APIC-edge        timer
    1:   941           0            0           0     IO-APIC-edge        keyboard
    ... (etc.)
   19:   941           0            0           0     IO-APIC-fasteoi      eth0
    ... (etc.)

Does the first column in this table give priority level of interrupts? I just want to learn priority levels, because I want to increase my NIC's interrupt priority level for better network performance. I think, first two interrupts cannot be changed (I guess due to intel x86 architecture).

Anyway, here is my question:

Is it possible to increase priority level of my NIC's interrupts?


回答1:


The vanilla kernel does not prioritize interrupts. This was an early design decision in the development of the kernel. There are two ways that you can get around this.

First, you can write a kernel module to program the interrupt controller for your processor to give the NIC interrupt highest priority. This will change the NIC interrupt priority underneath the kernel at the hardware level.

Second, you can build the kernel with the PREEMPT_RT patch and give the kernel thread that handles the NIC interrupts the highest priority.

Both of these approaches will increase the priority of the handling of the network interrupts. However, neither of these is likely to give you better network performance (whatever that means) because much of the overhead of IP, either TCP of UDP is in the IP stack, not in the processing of the NIC interrupts. In fact, using the PREEMPT_RT patch might even result in network performance degradation.



来源:https://stackoverflow.com/questions/20420645/how-to-give-highest-priority-to-ethernet-interrupt-in-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!