Proxmox VE 为PCIe设备绑定CPU线程

PVE 设置PCIe CPU亲和力,将PCIe设备固定到某些核心,使虚拟机性能更好。主要是通过IRQ的CPU亲和力设置。

首先找到你的PCIe设备号如,01:00

查看PCIe的IRQ号

cat /proc/interrupts |grep "01:00\|CPU"

  • root@pve1:/proc/irq/166# cat /proc/interrupts |grep "01:00\|CPU"
  • CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7
  • 166: 1221 0 39150443 115 35583 0 748 63430 IR-PCI-MSI 524288-edge vfio-msix[
  • root@pve1:/proc/irq/166#

这个166就是irq号

 

将166绑定到cpu 5-6去

echo 5-6 > /proc/irq/166/smp_affinity_list

这样,再查看中断,会发现CPU5-6有明显的中断数。

  • root@pve1:/proc/irq/166# cat /proc/interrupts |grep "01:00\|CPU"
  • CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7
  • 166: 1221 0 39150443 115 35583 296 748 64237 IR-PCI-MSI 524288-edge vfio-msix[0](0000:01:00.0)

在PVE上实现,可以参考pve-helpers

 

ayufan/pve-helpers: A set of Proxmox VE scripts that aids with suspend/resume and cpu pinning (github.com)

 

版权声明:
作者:佛西
链接:https://foxi.buduanwang.vip/virtualization/pve/2669.html/
文章版权归作者所有,未经允许请勿转载
如需获得支持,请点击网页右上角
THE END
分享
二维码
海报
<<上一篇
下一篇>>
目 录