diff --git a/nova/virt/hardware.py b/nova/virt/hardware.py index f004aa43917b63de35127d19b03278e811d50a54..d372d7691dbeaa711363d0e64e11839f29b9efc8 100644 --- a/nova/virt/hardware.py +++ b/nova/virt/hardware.py @@ -2674,33 +2674,31 @@ def virtcca_numa_fit_instance_to_host( host_cells, len(instance_topology)): chosen_instance_cells: ty.List['objects.InstanceNUMACell'] = [] chosen_host_cells: ty.List['objects.NUMACell'] = [] - # for host_cell, instance_cell in zip( - # host_cell_perm, instance_topology.cells): - for host_cell in host_cell_perm: - cell_index = 0 - for instance_cell in instance_topology.cells: - try: - cpuset_reserved = 0 - if (instance_topology.emulator_threads_isolated and - len(chosen_instance_cells) == 0): - # For the case of isolate emulator threads, to - # make predictable where that CPU overhead is - # located we always configure it to be on host - # NUMA node associated to the guest NUMA node - # 0. - cpuset_reserved = 1 - got_cell = _virtcca_numa_fit_instance_cell( - host_cell, instance_cell, limits, cpuset_reserved, imageMeta, cell_index) - except exception.MemoryPageSizeNotSupported: - # This exception will been raised if instance cell's - # custom pagesize is not supported with host cell in - # _numa_cell_supports_pagesize_request function. - break - if got_cell is None: - break - cell_index = cell_index + 1 - chosen_host_cells.append(host_cell) - chosen_instance_cells.append(got_cell) + cell_index = 0 + for host_cell, instance_cell in zip( + host_cell_perm, instance_topology.cells): + try: + cpuset_reserved = 0 + if (instance_topology.emulator_threads_isolated and + len(chosen_instance_cells) == 0): + # For the case of isolate emulator threads, to + # make predictable where that CPU overhead is + # located we always configure it to be on host + # NUMA node associated to the guest NUMA node + # 0. + cpuset_reserved = 1 + got_cell = _virtcca_numa_fit_instance_cell( + host_cell, instance_cell, limits, cpuset_reserved, imageMeta, cell_index) + except exception.MemoryPageSizeNotSupported: + # This exception will been raised if instance cell's + # custom pagesize is not supported with host cell in + # _numa_cell_supports_pagesize_request function. + break + if got_cell is None: + break + cell_index = cell_index + 1 + chosen_host_cells.append(host_cell) + chosen_instance_cells.append(got_cell) if len(chosen_instance_cells) != len(host_cell_perm): continue