From a6a5c653357cf0fd82c489501b6bdbacb2aaf65b Mon Sep 17 00:00:00 2001 From: kalyanreddy Date: Thu, 25 May 2017 15:01:40 +0530 Subject: Qemu: Mechanism to pass extra qemu cpu features and pin vCPU threads JIRA: VSPERF-510 This patch is used to implement the mechanism to pass extra qemu cpu options required to achieve better results/performance. Also used to implement a mechanism to pin the vCPU threads to another pCPU core which helps in reducing the noise from housekeeping thread and packet loss. Change-Id: Ic40fd47d7c4f5556f7e240c6ca671a0535d06ece Signed-off-by: Gundarapu Kalyan Reddy --- vnfs/qemu/qemu.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'vnfs/qemu') diff --git a/vnfs/qemu/qemu.py b/vnfs/qemu/qemu.py index a9ce176a..b48f7630 100644 --- a/vnfs/qemu/qemu.py +++ b/vnfs/qemu/qemu.py @@ -88,7 +88,7 @@ class IVnfQemu(IVnf): S.getValue('TOOLS')['qemu-system'], '-m', S.getValue('GUEST_MEMORY')[self._number], '-smp', str(S.getValue('GUEST_SMP')[self._number]), - '-cpu', 'host,migratable=off', + '-cpu', str(S.getValue('GUEST_CPU_OPTIONS')[self._number]), '-drive', 'if={},file='.format(S.getValue( 'GUEST_BOOT_DRIVE_TYPE')[self._number]) + S.getValue('GUEST_IMAGE')[self._number], @@ -233,12 +233,13 @@ class IVnfQemu(IVnf): for cpu in range(0, int(S.getValue('GUEST_SMP')[self._number])): match = None + guest_thread_binding = S.getValue('GUEST_THREAD_BINDING')[self._number] + if guest_thread_binding is None: + guest_thread_binding = S.getValue('GUEST_CORE_BINDING')[self._number] for line in output.decode(cur_locale).split('\n'): match = re.search(thread_id % cpu, line) if match: - self._affinitize_pid( - S.getValue('GUEST_CORE_BINDING')[self._number][cpu], - match.group(1)) + self._affinitize_pid(guest_thread_binding[cpu], match.group(1)) break if not match: -- cgit 1.2.3-korg