Disable pre-allocation of 2M hugepages on VBox

Slow performance was observed in vbox with the default
2M hugepages allocation.

This update disables the default 2M hugepages allocation
in vbox. Users are expected to allocate desired huge pages
via CLI or Horizon.

In addition, the default platform reserved memory has been
increased to 2500M on the worker nodes running in vbox.

Fixes-Bug: 1825814

Change-Id: I2558bcde76a23f1293e07486dbbe5a4b6f91db2f
Signed-off-by: Tao Liu <tao.liu@windriver.com>
This commit is contained in:
Tao Liu 2019-05-02 10:45:11 -04:00
parent d6f638cf5c
commit e51976083e
3 changed files with 17 additions and 3 deletions

View File

@ -3690,7 +3690,8 @@ class HostController(rest.RestController):
# allocated and the compute label is set
if cutils.has_openstack_compute(labels) and \
vm_hugepages_nr_2M == 0 and \
vm_hugepages_nr_1G == 0:
vm_hugepages_nr_1G == 0 and \
cutils.is_default_huge_pages_required(ihost):
vm_hugepages_nr_2M = m.vm_hugepages_possible_2M * 0.9
value.update({'vm_hugepages_nr_2M': vm_hugepages_nr_2M})

View File

@ -218,6 +218,7 @@ DISK_IO_RESIDENT_SET_SIZE_MIB_VBOX = 500
# Memory reserved for platform core in MiB per host
PLATFORM_CORE_MEMORY_RESERVED_MIB = 2000
PLATFORM_CORE_MEMORY_RESERVED_MIB_VBOX = 1100
PLATFORM_CORE_MEMORY_RESERVED_MIB_VBOX_WORKER = 2000
# For combined node, memory reserved for controller in MiB
COMBINED_NODE_CONTROLLER_MEMORY_RESERVED_MIB = 10500

View File

@ -960,8 +960,12 @@ def get_required_platform_reserved_memory(ihost, numa_node, low_core=False):
required_reserved += constants.DISK_IO_RESIDENT_SET_SIZE_MIB_VBOX
if host_has_function(ihost, constants.WORKER):
if numa_node == 0:
required_reserved += \
constants.PLATFORM_CORE_MEMORY_RESERVED_MIB_VBOX
if ihost['personality'] == constants.WORKER:
required_reserved += \
constants.PLATFORM_CORE_MEMORY_RESERVED_MIB_VBOX_WORKER
else:
required_reserved += \
constants.PLATFORM_CORE_MEMORY_RESERVED_MIB_VBOX
if host_has_function(ihost, constants.CONTROLLER):
required_reserved += \
constants.COMBINED_NODE_CONTROLLER_MEMORY_RESERVED_MIB_VBOX
@ -1974,3 +1978,11 @@ def recur_update(orig_dict, new_dict):
else:
orig_dict[key] = new_dict[key]
return orig_dict
def is_default_huge_pages_required(host):
if not host_has_function(host, constants.WORKER):
return False
if is_virtual() or is_virtual_worker(host):
return False
return True