Merge "Power on cores for isolated emulator threads" into stable/2023.1

This commit is contained in:
Zuul 2024-04-09 18:06:38 +00:00 committed by Gerrit Code Review
commit ffc95fe7cc
2 changed files with 24 additions and 3 deletions

View File

@ -147,7 +147,26 @@ class PowerManagementTests(PowerManagementTestsBase):
self.assertTrue(
numa_topology.cpu_pinning.isdisjoint(
numa_topology.cpuset_reserved))
# FIXME(artom) We've not actually powered on the emulator threads core
self._assert_cpu_set_state(numa_topology.cpuset_reserved,
expected='online')
def test_start_stop_server_with_emulator_threads_isolate(self):
server = self._create_server(
flavor_id=self.isolate_flavor_id,
expected_state='ACTIVE')
# Let's verify that the pinned CPUs are now online
self._assert_server_cpus_state(server, expected='online')
instance = objects.Instance.get_by_uuid(self.ctxt, server['id'])
numa_topology = instance.numa_topology
# Make sure we've pinned the emulator threads to a separate core
self.assertTrue(numa_topology.cpuset_reserved)
self.assertTrue(
numa_topology.cpu_pinning.isdisjoint(
numa_topology.cpuset_reserved))
self._assert_cpu_set_state(numa_topology.cpuset_reserved,
expected='online')
# Stop and assert we've powered down the emulator threads core as well
server = self._stop_server(server)
self._assert_cpu_set_state(numa_topology.cpuset_reserved,
expected='offline')

View File

@ -82,7 +82,8 @@ def power_up(instance: objects.Instance) -> None:
return
cpu_dedicated_set = hardware.get_cpu_dedicated_set_nozero() or set()
pcpus = instance.numa_topology.cpu_pinning
pcpus = instance.numa_topology.cpu_pinning.union(
instance.numa_topology.cpuset_reserved)
powered_up = set()
for pcpu in pcpus:
if pcpu in cpu_dedicated_set:
@ -102,7 +103,8 @@ def power_down(instance: objects.Instance) -> None:
return
cpu_dedicated_set = hardware.get_cpu_dedicated_set_nozero() or set()
pcpus = instance.numa_topology.cpu_pinning
pcpus = instance.numa_topology.cpu_pinning.union(
instance.numa_topology.cpuset_reserved)
powered_down = set()
for pcpu in pcpus:
if pcpu in cpu_dedicated_set: