Change I5f5c621f2f0fa1bc18ee9a97d17085107a5dee53 modified how we
evaluated available memory for instances with a NUMA topology.
Previously, we used a non-pagesize aware check unless the user had
explicitly requested a specific pagesize. This means that for instances
without pagesize requests, nova considers hugepages as available memory
when deciding if a host has enough available memory for the instance.
The aforementioned change modified this so that all NUMA-based
instances, whether they had hugepages or not, would use the
pagesize-aware check. Unfortunately the functionality it was reusing to
do this was functionality previously only used for hugepages. Hugepages
cannot be oversubscribed so we did not take oversubscription into
account, comparing against available memory on the host (i.e. memory not
consumed by other instances) rather than total memory. This is OK when
using hugepages but not small pages, where overcommit is OK.
Given that overcommit is already handled elsewhere in the code, we
simply modify the non-hugepage code path to check for available memory
of the lowest pagesize vs. total memory.
Change-Id: I890b2c81cd49c1c601e9baee6a249709d0f6810e
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Closes-Bug: #1810977