CPU Allocation

本文详细介绍了如何通过<cpu>元素定义虚拟机的最大虚拟CPU数量及其默认绑定的物理CPU列表。此外还讨论了<vcpu>元素中cpuset属性的作用,以及vcpupin和emulatorpin属性如何影响虚拟CPU的绑定策略。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<domain>
  ...
  <vcpu placement='static' cpuset="1-4,^3,6" current="1">2</vcpu>
  ...
</domain>


Figure 20.6. CPU allocation

The <cpu> element defines the maximum number of virtual CPUs (vCPUs) allocated for the guest virtual machine operating system, which must be between 1 and the maximum supported by the hypervisor. This element can contain an optional cpuset attribute, which is a comma-separated list of physical CPU numbers that domain processes and virtual CPUs can be pinned to by default.
Note that the pinning policy of domain processes and virtual CPUs can be specified separately by using the cputune attribute. If the emulatorpin attribute is specified in <cputune>, the cpuset value specified by <vcpu> will be ignored.
Similarly, virtual CPUs that have set a value for vcpupin cause cpuset settings to be ignored. Virtual CPUs where vcpupin is not specified will be pinned to the physical CPUs specified by cpuset. Each element in the cpuset list is either a single CPU number, a range of CPU numbers, or a caret (^) followed by a CPU number to be excluded from a previous range. The attribute current can be used to specify whether fewer than the maximum number of virtual CPUs should be enabled.
The optional attribute placement can be used to specify the CPU placement mode for the domain process. placement can be set as either static or auto. If you set <vcpu placement='auto'>, the system will query numad and use the settings specified in the <numatune> tag, and ignore any other settings in <vcpu> . If you set <vcpu placement='static'>, the system will use the settings specified in the <vcpu placement> tag instead of the settings in <numatune>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值