Hyper Threading Support on KVM

The Hyper Threading (HT) allows more than one thread to run on each core to enable more work in parallel.

To enabled or disabled HT, see the BIOS Settings section.

When HT is enabled on the UCS server, the total CPU number doubles, which impacts the following:

  • Isolation CPU setting

  • VM CPU allocation

  • UPF CPU Worker Count setting

Isolation CPU Pinning

When HT is disabled, one CPU from each socket is reserved for the base OS. The configuration is as follows:

cloud-user@user-bm-15-controlplane:~$ cat/proc/cmdline
BOOT_IMAGE=/vmlinuz
root=LABEL=cloudimg-rootfs ro intel_iommu=on isolcpus=1-19,21-39 hugepagesz=1G
            hugepages=312 console=ttyS0,115200 console=tty1

When HT is enabled, isolcpus parameter is set to:

isolcpus=1-19,21-39,41-59,61-79

CPU Worker Count

The VPP_CPU_WORKER_CNT is set in the day 0 configuration. It depends on a number of other parameters such as the UPF flavor configuration, SR-IOV, HT setting, and the vCPU allocation.

The VPP_CPU_WORKER_CNT is adjusted according to the UPF flavor configuration. The UPF VM can be with different flavors, such as full VM (1 UPF), half VM (2 UPFs) and quarter VM (4 UPFs) in the UCS environment.

The SR-IOV provides capabilities to configure multiple VFs per PF.

The NIC allows the number of Rx and Tx queues to be configured per VF. The maximum Rx and Tx queues depends on the SR-IOV or PCI_PT configuration. A maximum of 16 Rx and Tx queues can be configured per VF in SR-IOV.

The VPP_CPU_WORKER_CNT configuration overrides the default value for PCI_PT and SR-IOV.

When HT is enabled, the CPU number is doubled and the VPP_CPU_WORKER_CNT is also doubled.

The tables below summarizes the Worker Count details.

Parameters With HT Disabled

Flavor

Number of UPFs

Worker Count

Rx Queues

Tx Queues

vCPUs

Full

1

16

16

16

38

Half (default)

2

8

8

9

19

Quarter

4

4

4

5

9

Paraemeters with HT Enabled

Flavor

Number of UPFs

Worker Count

Rx Queues

Tx Queues

vCPUs

full

1

16

16

16

76

half (default)

2

16

16

16

38

quarter

4

8

8

9

18

You can check the worker count configuration as follows:

isoinfo -R -i /data/upf/libvirt/xml/upf1/upf1-cfg.iso -x /staros_param.cfg

Emulator Pinning

You can set the emulator pinning during the VM CPU allocation:

<emulatorpin cpuset="0,40”/> <emulatorpin cpuset="20,60”/>

To verify the VM CPU allocation, run the following command:

virsh dumpxml upf2

The KVM node must be redeployed if the HT setting is changed (for example, from enabled to disabled).