CPU Pinning understanding

Hi
I have successfully created a KVM, and i'm trying to follow this guide on how to do cpu pinning.

In their example XML code i see that they are passing the vCPU, and then the next thing that is written a cpuset. I don't quite understand what this is, and how it correlates in this way in their example.Could anyone please help me a bit here?
Here is my cpu layout, and I want to pass through everything but core 0. Which is then every vCPU except 0 and 16. But how should my xml look like then?

my: lscpu -e

CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE    MAXMHZ    MINMHZ
  0    0      0    0 0:0:0:0          yes 3500,0000 2200,0000
  1    0      0    1 1:1:1:0          yes 3500,0000 2200,0000
  2    0      0    2 2:2:2:0          yes 3500,0000 2200,0000
  3    0      0    3 3:3:3:0          yes 3500,0000 2200,0000
  4    0      0    4 4:4:4:1          yes 3500,0000 2200,0000
  5    0      0    5 5:5:5:1          yes 3500,0000 2200,0000
  6    0      0    6 6:6:6:1          yes 3500,0000 2200,0000
  7    0      0    7 7:7:7:1          yes 3500,0000 2200,0000
  8    0      0    8 8:8:8:2          yes 3500,0000 2200,0000
  9    0      0    9 9:9:9:2          yes 3500,0000 2200,0000
 10    0      0   10 10:10:10:2       yes 3500,0000 2200,0000
 11    0      0   11 11:11:11:2       yes 3500,0000 2200,0000
 12    0      0   12 12:12:12:3       yes 3500,0000 2200,0000
 13    0      0   13 13:13:13:3       yes 3500,0000 2200,0000
 14    0      0   14 14:14:14:3       yes 3500,0000 2200,0000
 15    0      0   15 15:15:15:3       yes 3500,0000 2200,0000
 16    0      0    0 0:0:0:0          yes 3500,0000 2200,0000
 17    0      0    1 1:1:1:0          yes 3500,0000 2200,0000
 18    0      0    2 2:2:2:0          yes 3500,0000 2200,0000
 19    0      0    3 3:3:3:0          yes 3500,0000 2200,0000
 20    0      0    4 4:4:4:1          yes 3500,0000 2200,0000
 21    0      0    5 5:5:5:1          yes 3500,0000 2200,0000
 22    0      0    6 6:6:6:1          yes 3500,0000 2200,0000
 23    0      0    7 7:7:7:1          yes 3500,0000 2200,0000
 24    0      0    8 8:8:8:2          yes 3500,0000 2200,0000
 25    0      0    9 9:9:9:2          yes 3500,0000 2200,0000
 26    0      0   10 10:10:10:2       yes 3500,0000 2200,0000
 27    0      0   11 11:11:11:2       yes 3500,0000 2200,0000
 28    0      0   12 12:12:12:3       yes 3500,0000 2200,0000
 29    0      0   13 13:13:13:3       yes 3500,0000 2200,0000
 30    0      0   14 14:14:14:3       yes 3500,0000 2200,0000
 31    0      0   15 15:15:15:3       yes 3500,0000 2200,0000

Here is the xml code that has me confused

...
<vcpu placement='static'>8</vcpu>
<iothreads>1</iothreads>
<cputune>
    <vcpupin vcpu='0' cpuset='2'/>
    <vcpupin vcpu='1' cpuset='8'/>
    <vcpupin vcpu='2' cpuset='3'/>
    <vcpupin vcpu='3' cpuset='9'/>
    <vcpupin vcpu='4' cpuset='4'/>
    <vcpupin vcpu='5' cpuset='10'/>
    <vcpupin vcpu='6' cpuset='5'/>
    <vcpupin vcpu='7' cpuset='11'/>
    <emulatorpin cpuset='0,6'/>
    <iothreadpin iothread='1' cpuset='0,6'/>
</cputune>
    ...
    <topology sockets='1' cores='4' threads='2'/>
    ...

I don't understand why their "cpuset" seems to be so random. From their lscpu -e output

CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ    MINMHZ
0   0    0      0    0:0:0:0       yes    4600.0000 800.0000
1   0    0      1    1:1:1:0       yes    4600.0000 800.0000
2   0    0      2    2:2:2:0       yes    4600.0000 800.0000
3   0    0      3    3:3:3:0       yes    4600.0000 800.0000
4   0    0      4    4:4:4:0       yes    4600.0000 800.0000
5   0    0      5    5:5:5:0       yes    4600.0000 800.0000
6   0    0      0    0:0:0:0       yes    4600.0000 800.0000
7   0    0      1    1:1:1:0       yes    4600.0000 800.0000
8   0    0      2    2:2:2:0       yes    4600.0000 800.0000
9   0    0      3    3:3:3:0       yes    4600.0000 800.0000
10  0    0      4    4:4:4:0       yes    4600.0000 800.0000
11  0    0      5    5:5:5:0       yes    4600.0000 800.0000

This is what i have tried through deduction and reading, I do not feel confident this is correct however.

virsh capabilities | grep "cpu id"

            <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0,16'/>
            <cpu id='1' socket_id='0' die_id='0' core_id='1' siblings='1,17'/>
            <cpu id='2' socket_id='0' die_id='0' core_id='2' siblings='2,18'/>
            <cpu id='3' socket_id='0' die_id='0' core_id='3' siblings='3,19'/>
            <cpu id='4' socket_id='0' die_id='0' core_id='4' siblings='4,20'/>
            <cpu id='5' socket_id='0' die_id='0' core_id='5' siblings='5,21'/>
            <cpu id='6' socket_id='0' die_id='0' core_id='6' siblings='6,22'/>
            <cpu id='7' socket_id='0' die_id='0' core_id='7' siblings='7,23'/>
            <cpu id='8' socket_id='0' die_id='0' core_id='8' siblings='8,24'/>
            <cpu id='9' socket_id='0' die_id='0' core_id='9' siblings='9,25'/>
            <cpu id='10' socket_id='0' die_id='0' core_id='10' siblings='10,26'/>
            <cpu id='11' socket_id='0' die_id='0' core_id='11' siblings='11,27'/>
            <cpu id='12' socket_id='0' die_id='0' core_id='12' siblings='12,28'/>
            <cpu id='13' socket_id='0' die_id='0' core_id='13' siblings='13,29'/>
            <cpu id='14' socket_id='0' die_id='0' core_id='14' siblings='14,30'/>
            <cpu id='15' socket_id='0' die_id='0' core_id='15' siblings='15,31'/>
            <cpu id='16' socket_id='0' die_id='0' core_id='0' siblings='0,16'/>
            <cpu id='17' socket_id='0' die_id='0' core_id='1' siblings='1,17'/>
            <cpu id='18' socket_id='0' die_id='0' core_id='2' siblings='2,18'/>
            <cpu id='19' socket_id='0' die_id='0' core_id='3' siblings='3,19'/>
            <cpu id='20' socket_id='0' die_id='0' core_id='4' siblings='4,20'/>
            <cpu id='21' socket_id='0' die_id='0' core_id='5' siblings='5,21'/>
            <cpu id='22' socket_id='0' die_id='0' core_id='6' siblings='6,22'/>
            <cpu id='23' socket_id='0' die_id='0' core_id='7' siblings='7,23'/>
            <cpu id='24' socket_id='0' die_id='0' core_id='8' siblings='8,24'/>
            <cpu id='25' socket_id='0' die_id='0' core_id='9' siblings='9,25'/>
            <cpu id='26' socket_id='0' die_id='0' core_id='10' siblings='10,26'/>
            <cpu id='27' socket_id='0' die_id='0' core_id='11' siblings='11,27'/>
            <cpu id='28' socket_id='0' die_id='0' core_id='12' siblings='12,28'/>
            <cpu id='29' socket_id='0' die_id='0' core_id='13' siblings='13,29'/>
            <cpu id='30' socket_id='0' die_id='0' core_id='14' siblings='14,30'/>
            <cpu id='31' socket_id='0' die_id='0' core_id='15' siblings='15,31'/>

xml code

<cputune>
    <vcpupin vcpu="0" cpuset="1"/>
    <vcpupin vcpu="1" cpuset="17"/>
    <vcpupin vcpu="2" cpuset="2"/>
    <vcpupin vcpu="3" cpuset="18"/>
    <vcpupin vcpu="4" cpuset="3"/>
    <vcpupin vcpu="5" cpuset="19"/>
    <vcpupin vcpu="6" cpuset="4"/>
    <vcpupin vcpu="7" cpuset="20"/>
    <vcpupin vcpu="8" cpuset="5"/>
    <vcpupin vcpu="9" cpuset="21"/>
    <vcpupin vcpu="10" cpuset="6"/>
    <vcpupin vcpu="12" cpuset="22"/>
    <vcpupin vcpu="13" cpuset="7"/>
    <vcpupin vcpu="14" cpuset="23"/>
    <vcpupin vcpu="15" cpuset="8"/>
    <vcpupin vcpu="16" cpuset="24"/>
    <vcpupin vcpu="17" cpuset="9"/>
    <vcpupin vcpu="18" cpuset="25"/>
    <vcpupin vcpu="19" cpuset="10"/>
    <vcpupin vcpu="20" cpuset="26"/>
    <vcpupin vcpu="21" cpuset="11"/>
    <vcpupin vcpu="22" cpuset="27"/>
    <vcpupin vcpu="23" cpuset="12"/>
    <vcpupin vcpu="24" cpuset="28"/>
    <vcpupin vcpu="25" cpuset="13"/>
    <vcpupin vcpu="26" cpuset="29"/>
    <vcpupin vcpu="27" cpuset="14"/>
    <vcpupin vcpu="28" cpuset="30"/>
    <vcpupin vcpu="29" cpuset="15"/>
    <vcpupin vcpu="30" cpuset="31"/>
    <emulatorpin cpuset="0,16"/>
    <iothreadpin iothread='1' cpuset='0,16'/>
</cputune>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by