From cbd9634bc266d70baf90a9c65e02e03778dd98b2 Mon Sep 17 00:00:00 2001 From: Sahid Orentino Ferdjaoui Date: Tue, 17 Apr 2018 07:21:38 -0400 Subject: [PATCH] libvirt: always pass emulator threads policy It's necessary to pass the policy since in the following change we will handle the special case with SHARE and CONF.cpu_shared_set configured. Change-Id: Icab6a16993e2d3a69ab60fd512981bc65d7f6eb3 Signed-off-by: Sahid Orentino Ferdjaoui Partial-implement: bp/overhead-pin-set --- nova/virt/libvirt/driver.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index bc59a329fe..bd5de8b420 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -4288,7 +4288,7 @@ class LibvirtDriver(driver.ComputeDriver): return pin_cpuset def _get_emulatorpin_cpuset(self, vcpu, object_numa_cell, vcpus_rt, - emulator_threads_isolated, wants_realtime, + emulator_threads_policy, wants_realtime, pin_cpuset): """Returns a set of cpu_ids to add to the cpuset for emulator threads with the following caveats: @@ -4306,7 +4306,7 @@ class LibvirtDriver(driver.ComputeDriver): """ emulatorpin_cpuset = set([]) - if emulator_threads_isolated: + if emulator_threads_policy == fields.CPUEmulatorThreadsPolicy.ISOLATE: if object_numa_cell.cpuset_reserved: emulatorpin_cpuset = object_numa_cell.cpuset_reserved elif not wants_realtime or vcpu not in vcpus_rt: @@ -4386,8 +4386,10 @@ class LibvirtDriver(driver.ComputeDriver): guest_numa_tune.memory = vconfig.LibvirtConfigGuestNUMATuneMemory() guest_numa_tune.memnodes = [] - emulator_threads_isolated = ( - instance_numa_topology.emulator_threads_isolated) + emulator_threads_policy = None + if 'emulator_threads_policy' in instance_numa_topology: + emulator_threads_policy = ( + instance_numa_topology.emulator_threads_policy) # Set realtime scheduler for CPUTune vcpus_rt = set([]) @@ -4417,7 +4419,7 @@ class LibvirtDriver(driver.ComputeDriver): emu_pin_cpuset = self._get_emulatorpin_cpuset( cpu, object_numa_cell, vcpus_rt, - emulator_threads_isolated, wants_realtime, pin_cpuset) + emulator_threads_policy, wants_realtime, pin_cpuset) guest_cpu_tune.emulatorpin.cpuset.update(emu_pin_cpuset) # TODO(berrange) When the guest has >1 NUMA node, it will