Bug 1534669

Summary: emulator_threads_policy needs improvement when hyper threading is enabled
Product: Red Hat OpenStack Reporter: jianzzha
Component: openstack-novaAssignee: Stephen Finucane <stephenfin>
Status: CLOSED ERRATA QA Contact: Joe H. Rahme <jhakimra>
Severity: medium Docs Contact:
Priority: medium    
Version: 12.0 (Pike)CC: berrange, bshephar, dasmith, eglynn, jianzzha, jraju, kchamart, lyarwood, mbooth, sbauza, sgordon, srevivo, stephenfin, vromanso
Target Milestone: Upstream M2Keywords: Triaged
Target Release: 14.0 (Rocky)   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-nova-18.0.0-0.20180710150340.8469fa7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-11 11:48:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1608105    
Attachments:
Description Flags
email-thread-with-Ferdjaoui none

Description jianzzha 2018-01-15 17:26:57 UTC
Created attachment 1381592 [details]
email-thread-with-Ferdjaoui

Description of problem:
When hyper threading is enabled, the way emulator_threads_policy allocates the extra cpu resource for emulator is not optimal.

The instance I use for testing is a 6-vcpu VM; before enable this emulator_threads_policy, I reserve 6 cpu (actually 6 threads since we enable hyper threading) in nova config,
vcpu_pin_set=8,10,12,32,34,36

Now when we enable emulator_threads_policy, in stead of adding one more thread to this vcpu pin list in the nova config, I end up adding two more sibling threads (on the same core)
 vcpu_pin_set=8,10,12,16,32,34,36,40

So I ended up using 2 more threads, but only of them is used for emulator and the other thread is wasted.

Comment 1 Stephen Finucane 2018-01-19 09:54:13 UTC
My first question upon reading this was why don't you just reserve 7 CPUs instead of 8?

  vcpu_pin_set=8,10,12,16,32,34,36

However, upon reading the attached email, it seems that this is broken and returns the following message:

  No valid host was found. There are not enough hosts available.

So configuring vcpu_pin_set to include cores and their sibling works, but not including at least one sibling breaks. Is this correct?

Comment 2 jianzzha 2018-01-19 14:17:23 UTC
(In reply to Stephen Finucane from comment #1)
> My first question upon reading this was why don't you just reserve 7 CPUs
> instead of 8?
> 
>   vcpu_pin_set=8,10,12,16,32,34,36
> 
> However, upon reading the attached email, it seems that this is broken and
> returns the following message:
> 
>   No valid host was found. There are not enough hosts available.
> 
> So configuring vcpu_pin_set to include cores and their sibling works, but
> not including at least one sibling breaks. Is this correct?

Yes. reserving 7 CPUs didn't work for me.

Comment 3 Stephen Finucane 2018-01-25 14:09:17 UTC
There's a patch upstream for this now. It's rather lengthy, but I hope to get it merged sharpish all the same.

Comment 6 Stephen Finucane 2018-04-23 13:42:46 UTC
All of these patches have been merged now.

Comment 12 errata-xmlrpc 2019-01-11 11:48:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2019:0045