红帽大师Daniel Macpherson在a Red Hat community discussion中说: 因此,您可能需要限制内核访问已固定到示例的CPU。例如,假设我有一个具有双超线程的8核CPU,这将产生16个vcpu。我希望将核心0用于OpenStack服务,将核心1-7用于示例。我需要告诉内核不要使用这些核心。这意味着我“d需要告诉内核不要管vcpu 1-7和9-15:
isolcpus= [KNL,SMP] Isolate CPUs from the general scheduler.
Format:
<cpu number>,...,<cpu number>
or
<cpu number>-<cpu number>
(must be a positive range in ascending order)
or a mixture
<cpu number>,...,<cpu number>-<cpu number>
This option can be used to specify one or more CPUs
to isolate from the general SMP balancing and scheduling
algorithms. You can move a process onto or off an
"isolated" CPU via the CPU affinity syscalls or cpuset.
<cpu number> begins at 0 and the maximum value is
"number of CPUs in system - 1".
This option is the preferred way to isolate CPUs. The
alternative -- manually setting the CPU mask of all
tasks in the system -- can cause problems and
suboptimal load balancer performance.
2条答案
按热度按时间sirbozc51#
红帽大师Daniel Macpherson在a Red Hat community discussion中说:
因此,您可能需要限制内核访问已固定到示例的CPU。例如,假设我有一个具有双超线程的8核CPU,这将产生16个vcpu。我希望将核心0用于OpenStack服务,将核心1-7用于示例。我需要告诉内核不要使用这些核心。这意味着我“d需要告诉内核不要管vcpu 1-7和9-15:
据此,可以为
isolcpus
内核参数指定logical CPU cores。wtzytmuj2#
是开源的。
Documentation/kernel-parameters.txt
如果这还不够,只需搜索isolcplus的源代码并查看如何使用。