22.4. 使用 tuna 工具调优 IRQ
/proc/interrupts
文件记录每个 IRQ 的中断数、中断类型和位于 IRQ 的设备的名称。
先决条件
-
tuna
工具已安装。如需更多信息 ,请参阅安装 tuna 工具。
流程
查看当前的 IRQ 及其关联性:
tuna show_irqs users affinity
# tuna show_irqs # users affinity 0 timer 0 1 i8042 0 7 parport0 0
Copy to Clipboard Copied! 指定要受某一命令影响的 IRQ 的列表:
tuna <command> --irqs irq_list --cpus cpu_list
# tuna <command> --irqs irq_list --cpus cpu_list
Copy to Clipboard Copied! - irq_list 参数是用逗号分开的 IRQ 编号或 user-name 模式的列表。
-
将
<command
> 替换为如-spread
。
将一个中断移到指定的 CPU 中:
tuna show_irqs --irqs <128> tuna move --irqs 128 --cpus 3
# tuna show_irqs --irqs <128> users affinity 128 iwlwifi 0,1,2,3 # tuna move --irqs 128 --cpus 3
Copy to Clipboard Copied! -
使用 irq_list 参数替换 128,将
3
替换为 cpu_list 参数。 -
cpu_list 参数是一个用逗号分开的 CPU 号列表,如--
cpus 0,2
。如需更多信息,请参阅使用 tuna 工具调整 CPU。
-
使用 irq_list 参数替换 128,将
验证
在将任何中断移到特定的 CPU 之前和之后,比较所选 IRQs 的状态:
tuna show_irqs --irqs 128
# tuna show_irqs --irqs 128 users affinity 128 iwlwifi 3
Copy to Clipboard Copied!