virshã®vcpupinã¨vcpuinfoã§è¡¨ç¤ºãããaffinityã®éã
以åvirsh vcpupin
㨠virsh vcpuinfo
ã§è¡¨ç¤ºãããCPUã®Affinityæ
å ±ãéãã¨ãããã¨ãããã¾ããï¼
% sudo virsh vcpupin vm1 VCPU CPU Affinity ---------------------- 0 0-47 1 0-47 2 0-47 [...]
% sudo virsh vcpuinfo vm1 VCPU: 0 CPU: 25 State: running CPU time: 508.0s CPU Affinity: ------------------------yyyyyyyyyyyyyyyyyyyyyyyy
åä½çã«ã¯ virsh vcpuinfo
ã®æ
å ±ã®æ¹ãæ£ããï¼ãªãã§ããªãã¨æã£ã¦ããã§ããï¼ã½ã¼ã¹ã調ã¹ã¦ã¿ãã virsh vcpuinfo
ã¯å¼ã°ãããã³ã« sched_getaffinity()
ã§ã¢ãã£ããã£ãåå¾ããã®ã«å¯¾ãã¦ï¼ virsh vcpupin
ã®æ¹ã¯libvirtå
é¨ã®æ
å ±ãåç
§ãã¦ããããã§ããï¼çµæã¨ãã¦libvirtã®å¤é¨ããCPUã¢ãã£ããã£ãå¤æ´ãããã¨ãã®ããã«æ
å ±ã«å·®ç°ãçããããã§ãï¼
å®éã«libvirtdãstraceãããï¼bpftraceãªã©ã§ sched_getaffinity()
ã®å¼ã³åºããç£è¦ããã¨ï¼ virsh cpuinfo
ã³ãã³ããå®è¡ãã㨠shced_getaffinity()
ãå®è¡ãããã®ã«å¯¾ãã¦ï¼ããä¸æ¹ã¯ãããªããã¨ã確èªã§ãã¾ãï¼ãªãï¼virshã³ãã³ãã¯libvirtdã¨RPCã§ããã¨ããã¦ãã¾ãã®ã§ï¼virshã³ãã³ãã®æ¹ã対象ã«ç£è¦ãã¦ãçµæã¯å¾ããã¾ããï¼ï¼
ã¨ãããã¨ã§libvirtã使ã£ã¦ããã¨ãã²ã¹ãã®CPU affinityãç¥ããããªã virsh vcpuinfo
ã使ã£ãæ¹ãè¯ãã¨ãã話ã§ããï¼â»ãã¡ã2020å¹´10æããã®libvirtdãã³ã³ãã¤ã«ãã¦ä½¿ã£ãã¨ãã®æ
å ±ã«ãªãã¾ãï¼ï¼