yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #44034
[Bug 1501358] Re: cpu pinning on the host that has siblings does not work properly in some cases (instance with odd CPUs)
*** This bug is a duplicate of bug 1467927 ***
https://bugs.launchpad.net/bugs/1467927
Reviewed: https://review.openstack.org/229575
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=d5bed8fad9d51dd0d4ba9cf452c6f5c8c543b264
Submitter: Jenkins
Branch: master
commit d5bed8fad9d51dd0d4ba9cf452c6f5c8c543b264
Author: Nikola Dipanov <ndipanov@xxxxxxxxxx>
Date: Wed Sep 30 19:30:59 2015 +0100
Fix CPU pinning for odd number of CPUs w hyperthreading
Previous logic was not handling the cases when the instance cell has an
odd number of vcpus that is larger than any sibling set on the host. The
logic would (accidentally) either reject to pin such an instance even
though there is ample free cores, or would (in case there were enough
free sibling sets on the host) spread the instance instead of pack it
onto siblings as the default policy suggests.
This patch fixes some incorrect assumptions in the code, while also
simplifying it. As an added bonus - we still attempt to expose
(via the Topology, and this time correctly) the largest possible number
of threads that we can expose to the instance.
Finally - we add some more comments to clear up the intent behind the
current packing logic with pointers how it could be tweaked to achieve
different results in the future.
Change-Id: I2c0b3b250ffb1a7483299df13b317cdb24f8141d
Co-Authored-By: Stephen Finucane <stephen.finucane@xxxxxxxxx>
Closes-bug: 1501358
Closes-bug: 1467927
** Changed in: nova
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1501358
Title:
cpu pinning on the host that has siblings does not work properly in
some cases (instance with odd CPUs)
Status in OpenStack Compute (nova):
Fix Released
Bug description:
Calculating CPU pinning for an instance for the host with
hyperthreading fails in certain cases. Most notably when the instance
has an odd number of CPUs, due to a bug in the logic we might either
fail to pin entirely or end up avoiding siblings by accident, although
the default policy should be to prefer them (which is what happens
when we have an even number of CPUs).
Consider a host with CPUs [(0, 3), (1, 4), (2, 5)] (brackets denote
thread siblings). Instance with 5 CPUs would fail to get fitted onto
this host even though it's clear that it's absolutely possible to fit
that instance on there.
Another unexpected result happens when we have a host [[0, 8], [1, 9],
[2, 10], [3, 11], [4, 12], [5, 13], [6, 14], [7, 15]] and a 5 CPU
instance. In this case an instance with 5 CPUs would get pinned as
follows (instance cpu -> host cpu): [(0 -> 0), (1 -> 1), (2 -> 2), (3
-> 3), (4 -> 4)] which is wrong since the default for instances with
an even number of CPUs would be to prefer sibling CPUs.
After inspecting the fitting logic code:
https://github.com/openstack/nova/blob/b0013d93ffeaed53bc28d9558def26bdb7041ed7/nova/virt/hardware.py#L653
I also noticed that we would consult the existing topology of the
instance NUMA cell when deciding on the proper way to fit instance
CPUs onto host. This is actually wrong after
https://review.openstack.org/#/c/198312/. We don't need to consider
the requested topology in the CPU fitting any more as the code that
decides on the final CPU topology takes all of this into account.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1501358/+subscriptions
References