IvyBridge && ESXi && CentOS環境でirqbalanceが起動後数秒で終了する問題

環境

  • CPU
    • IvyBridge系
  • Hypervisor
  • Guest OS (Virtual CPU: 1Socket 4Core)
  • irqbalance (rpm package)
    • irqbalance-1.0.4-8.el6_5.x86_64

問題

上記環境でirqbalanceを実行すると以下のように数秒で終了してしまう。
終了時の標準出力も無し。

[root@testvm1:~]$ time /usr/sbin/irqbalance -d
# 省略
real    0m9.578s
user    0m0.002s
sys     0m0.003s

原因

以下2つの挙動が重なって今回の問題が発生していた。

1.Sandy Bridge構成とIvy Bridge構成とではVMから見えるCache domainの数が異なる

[root@testvm2:~]$ /usr/sbin/irqbalance -d
Package 0:  numa_node is 0 cpu mask is 000000ff (load 0)
        Cache domain 0:  numa_node is 0 cpu mask is 00000001  (load 0)
                CPU number 0  numa_node is 0 (load 0)
        Cache domain 1:  numa_node is 0 cpu mask is 00000002  (load 0)
                CPU number 1  numa_node is 0 (load 0)
        Cache domain 2:  numa_node is 0 cpu mask is 00000004  (load 0)
                CPU number 2  numa_node is 0 (load 0)
        Cache domain 3:  numa_node is 0 cpu mask is 00000008  (load 0)
                CPU number 3  numa_node is 0 (load 0)
# 省略
[root@testvm1:~]$ /usr/sbin/irqbalance -d
Package 0:  numa_node is 0 cpu mask is 0000000f (load 0)
        Cache domain 0:  numa_node is 0 cpu mask is 0000000f  (load 0)
                CPU number 0  numa_node is 0 (load 0)
                CPU number 1  numa_node is 0 (load 0)
                CPU number 2  numa_node is 0 (load 0)
                CPU number 3  numa_node is 0 (load 0)
# 省略

2.rpm packageのirqbalanceはCache domainが1つしかない場合正常終了する

多分これでbug報告されているのと同じ: https://bugzilla.redhat.com/show_bug.cgi?id=1052166

[root@testvm1:~]$ /etc/init.d/irqbalance start
Starting irqbalance:                                       [  OK  ]
[root@testvm1:~]$ strace -p `ps aux|grep irqbalanc[e]|awk '{print $2}'`
# 省略
unlink("/var/run/irqbalance.pid")       = 0
exit_group(0)                           = ?
Process 1916 detached

対応

Cache domainが2つ以上になるようにVirtual CPUの構成を 1Socket 4Core から 2Socket 2Core に変更し問題を回避。