[SRU] Incorrect host cpu is given to emulator threads when cpu_realtime_mask flag is set
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Sahid Orentino | ||
Newton |
Fix Committed
|
Medium
|
Lee Yarwood | ||
Ubuntu Cloud Archive |
Fix Released
|
Undecided
|
Unassigned | ||
Mitaka |
Fix Released
|
Medium
|
Edward Hope-Morley | ||
nova (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[Impact]
This bug affects users of Openstack Nova who want to create instances that will leverage the realtime functionality that libvirt/qemu offers by, amongst other things, pinning guest vcpus and qemu emulator threads to specific pcpus. Nova provides the means for the user to control, via the flavor hw:cpu_
<cputune>
<vcpupin vcpu='0' cpuset='14'/>
<vcpupin vcpu='1' cpuset='22'/>
<emulatorpin cpuset='14'/>
<vcpusched vcpus='1' scheduler='fifo' priority='1'/>
</cputune>
But (current only Mitaka since it does not have this patch) you will get this:
<cputune>
<vcpupin vcpu='0' cpuset='14'/>
<vcpupin vcpu='1' cpuset='22'/>
<emulatorpin cpuset='0'/>
<vcpusched vcpus='1' scheduler='fifo' priority='1'/>
</cputune>
i.e. Nova will always set the emulator pin to be id of the vcpu instead of the corresponding pcpu that it is pinned to.
In terms of actual impact this could result in vcpus that are supposed to be isolated not being so and therefore not behaving as expected.
[Test Case]
* deploy openstack mitaka and configure nova.conf with vcpu-pin-
https:/
* configure compute host kernel opts with "isolcpus=0,1,2,3" + reboot
* create flavor with:
openstack flavor create --public --ram 2048 --disk 10 --vcpus 2 --swap 0 test_flavor
openstack flavor set --property hw:cpu_
openstack flavor set --property hw:cpu_
openstack flavor set --property hw:cpu_
openstack flavor set --property hw:cpu_realtime=yes test_flavor
* boot instance with ^^ flavor
* check that libvirt xml for vm has correct emulator pin cpuset #
[Regression Potential]
Since the patch being backported only touches the specific aread of code that was causing the original problem and that code only serves to select cpusets based on flavor filters, i can't think of any regressions that it would introduce. However, one potential side effect/change to be aware of is that once nova-compute is upgraded to this newer version, any new instances created will have the correct/expected cpuset assignments whereas instances created prior to upgrade will remain unchanged i.e. they will all likely still have their emulation threads pinned to the wrong pcpu. In terms of side effects this will mean less load on the pcpu that was previously incorrectly chosen for existing guests but it will mean that older instances will need to be recreated in order to benefit from the fix.
====
Description of problem:
When using the cpu_realtime and cpu_realtim_mask flag to create new instance, the 'cpuset' of 'emulatorpin' option is using the id of vcpu which is incorrect. The id of host cpu should be used here.
e.g.
<cputune>
<vcpupin vcpu='0' cpuset='2'/>
<vcpupin vcpu='1' cpuset='3'/>
<emulatorpin cpuset='0'/> ### the cpuset should be '2' here, when cpu_realtime_
<vcpusched vcpus='1' scheduler='fifo' priority='1'/>
</cputune>
How reproducible:
Boot new instance with cpu_realtime_mask flavor.
Steps to Reproduce:
1. Create RT flavor
nova flavor-create m1.small.
nova flavor-key m1.small.
nova flavor-key m1.small.
nova flavor-key m1.small.
2. Boot a instance with this flavor
3. Check the xml of the new instance
Actual results:
<cputune>
<vcpupin vcpu='0' cpuset='2'/>
<vcpupin vcpu='1' cpuset='3'/>
<emulatorpin cpuset='0'/>
<vcpusched vcpus='1' scheduler='fifo' priority='1'/>
</cputune>
Expected results:
<cputune>
<vcpupin vcpu='0' cpuset='2'/>
<vcpupin vcpu='1' cpuset='3'/>
<emulatorpin cpuset='2'/>
<vcpusched vcpus='1' scheduler='fifo' priority='1'/>
</cputune>
Changed in nova: | |
assignee: | nobody → sahid (sahid-ferdjaoui) |
Changed in nova: | |
importance: | Undecided → Medium |
tags: |
added: newton-backport-potential removed: liberty-backport-potential |
tags: | added: mitaka-backport-potential |
tags: |
added: sts sts-sru-needed removed: mitaka-backport-potential |
description: | updated |
summary: |
- Incorrect host cpu is given to emulator threads when cpu_realtime_mask - flag is set + [SRU] Incorrect host cpu is given to emulator threads when + cpu_realtime_mask flag is set |
description: | updated |
tags: |
added: sts-sru-done removed: sts-sru-needed |
Fix proposed to branch: master /review. openstack. org/356383
Review: https:/