Skip to content

Commit 0a0c174

Browse files
committed
hardware: Don't consider overhead CPUs for unpinned instances
The 'cpuset_reserved' argument for the '_numa_fit_instance_cell' function is only ever non-zero if the 'isolate' CPU thread policy is in effect, and this thread policy can only be used if using the 'dedicated' CPU policy is used. As such, we don't need to worry about overhead if either the 'share' CPU thread policy or the 'shared' CPU policy is in effect. Part of blueprint use-pcpu-and-vcpu-in-one-instance Change-Id: Ib863b6a8d3bd3d2848fabd777fc1ac3387a7dd42 Signed-off-by: Stephen Finucane <[email protected]>
1 parent 690ce37 commit 0a0c174

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

nova/virt/hardware.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,8 +1127,6 @@ def _numa_fit_instance_cell(host_cell, instance_cell, limit_cell=None,
11271127
# NOTE(stephenfin): As with memory, do not allow an instance to overcommit
11281128
# against itself on any NUMA cell
11291129
if instance_cell.cpu_policy == fields.CPUAllocationPolicy.DEDICATED:
1130-
# TODO(stephenfin): Is 'cpuset_reserved' present if consuming emulator
1131-
# threads from shared CPU pools? If so, we don't want to add this here
11321130
required_cpus = len(instance_cell.cpuset) + cpuset_reserved
11331131
if required_cpus > len(host_cell.pcpuset):
11341132
LOG.debug('Not enough host cell CPUs to fit instance cell; '
@@ -1140,14 +1138,12 @@ def _numa_fit_instance_cell(host_cell, instance_cell, limit_cell=None,
11401138
})
11411139
return
11421140
else:
1143-
required_cpus = len(instance_cell.cpuset) + cpuset_reserved
1141+
required_cpus = len(instance_cell.cpuset)
11441142
if required_cpus > len(host_cell.cpuset):
11451143
LOG.debug('Not enough host cell CPUs to fit instance cell; '
1146-
'required: %(required)d + %(cpuset_reserved)d as '
1147-
'overhead, actual: %(actual)d', {
1144+
'required: %(required)d, actual: %(actual)d', {
11481145
'required': len(instance_cell.cpuset),
11491146
'actual': len(host_cell.cpuset),
1150-
'cpuset_reserved': cpuset_reserved
11511147
})
11521148
return
11531149

0 commit comments

Comments
 (0)