Browse Source

Merge "Provide option to set reserved_huge_pages" into stable/rocky

changes/34/691934/2
Zuul 1 month ago
parent
commit
a13c8db87e
2 changed files with 95 additions and 0 deletions
  1. +85
    -0
      puppet/services/nova-compute.yaml
  2. +10
    -0
      releasenotes/notes/NovaReservedHugePages-35a13e828bfc92e9.yaml

+ 85
- 0
puppet/services/nova-compute.yaml View File

@@ -146,6 +146,34 @@ parameters:
- range: { min: 512 }
tags:
- role_specific
NovaReservedHugePages:
description: >
A list of valid key=value which reflect NUMA node ID,
page size (Default unit is KiB) and number of pages to be reserved.
Example -
NovaReservedHugePages: ["node:0,size:2048,count:64","node:1,size:1GB,count:1"]
will reserve on NUMA node 0 64 pages of 2MiB and on NUMA node 1 1 page of 1GiB
type: comma_delimited_list
default: []
tags:
- role_specific
KernelArgs:
default: ""
type: string
description: Kernel Args to apply to the host
tags:
- role_specific
OvsDpdkSocketMemory:
default: ""
description: >
Sets the amount of hugepage memory to assign per NUMA node. It is
recommended to use the socket closest to the PCIe slot used for the
desired DPDK NIC. The format should be in "<socket 0 mem>, <socket 1
mem>, <socket n mem>", where the value is specified in MB. For example:
"1024,0".
type: string
tags:
- role_specific
MonitoringSubscriptionNovaCompute:
default: 'overcloud-nova-compute'
type: string
@@ -253,6 +281,17 @@ conditions:
- equals: [{get_param: [RoleParameters, NovaEnableRbdBackend]}, '']
- equals: [{get_param: NovaEnableRbdBackend}, true]

reserved_huge_pages_set:
not:
and:
- equals: [{get_param: [RoleParameters, NovaReservedHugePages]}, ""]
- equals: [{get_param: NovaReservedHugePages}, []]

ovs_dpdk_socket_memory_not_set:
and:
- equals: [{get_param: [RoleParameters, OvsDpdkSocketMemory]}, ""]
- equals: [{get_param: OvsDpdkSocketMemory}, ""]

resources:
NovaBase:
type: ./nova-base.yaml
@@ -276,6 +315,7 @@ resources:
- nova::compute::vcpu_pin_set: NovaVcpuPinSet
nova::compute::cpu_shared_set: NovaComputeCpuSharedSet
nova::compute::reserved_host_memory: NovaReservedHostMemory
nova::compute::reserved_huge_pages: NovaReservedHugePages
nova::compute::neutron_physnets_numa_nodes_mapping: NeutronPhysnetNUMANodesMapping
nova::compute::neutron_tunnel_numa_nodes: NeutronTunnelNUMANodes
nova::compute::resume_guests_state_on_host_boot: NovaResumeGuestsStateOnHostBoot
@@ -296,6 +336,51 @@ resources:
NovaVcpuPinSet: {get_param: NovaVcpuPinSet}
NovaComputeCpuSharedSet: {get_param: NovaComputeCpuSharedSet}
NovaReservedHostMemory: {get_param: NovaReservedHostMemory}
NovaReservedHugePages:
#"repeat" function is run for the case when OvsDpdkSocketMemory is set
# and when neither global or role based NovaReservedHugePages are set.
if:
- reserved_huge_pages_set
- get_param: NovaReservedHugePages
- if:
- ovs_dpdk_socket_memory_not_set
- get_param: NovaReservedHugePages
- repeat:
for_each:
<%node%>:
yaql:
expression: range(0,len($.data.dpdk_p)).join(",").split(",")
data:
dpdk_p:
if:
- {equals: [{get_param: [RoleParameters, OvsDpdkSocketMemory]}, ""]}
- str_split: [',',{get_param: OvsDpdkSocketMemory}]
- str_split: [',',{get_param: [RoleParameters, OvsDpdkSocketMemory]}]
<%size%>:
yaql:
expression: let(hzx => regex("([0-9]+[K|M|G])").search($.data.kern_p+$.data.kern_g)) -> let(hz =>switch($hzx = "4K" => "4", $hzx = "2M" => "2048", $hzx = "1G" => "1048576", $hzx => "2048", $hzx = null => "2048")) -> [$hz]*len($.data.dpdk_p)
data:
dpdk_p:
if:
- {equals: [{get_param: [RoleParameters, OvsDpdkSocketMemory]}, ""]}
- str_split: [',',{get_param: OvsDpdkSocketMemory}]
- str_split: [',',{get_param: [RoleParameters, OvsDpdkSocketMemory]}]
kern_p: {get_param: [RoleParameters, KernelArgs]}
kern_g: {get_param: KernelArgs}
<%count%>:
yaql:
expression: let(hzx => regex("([0-9]+[K|M|G])").search($.data.kern_p+$.data.kern_g)) -> let(hz =>int(switch($hzx = "4K" => "4", $hzx = "2M" => "2048", $hzx = "1G" => "1048576", $hzx => "2048", $hzx = null => "2048"))) -> $.data.dpdk_p.select(int($)*1024/$hz).join(",").split(',')
data:
dpdk_p:
if:
- {equals: [{get_param: [RoleParameters, OvsDpdkSocketMemory]}, ""]}
- str_split: [',',{get_param: OvsDpdkSocketMemory}]
- str_split: [',',{get_param: [RoleParameters, OvsDpdkSocketMemory]}]
kern_p: {get_param: [RoleParameters, KernelArgs]}
kern_g: {get_param: KernelArgs}
template: >-
node:<%node%>,size:<%size%>,count:<%count%>
permutations: false
NeutronPhysnetNUMANodesMapping: {get_param: NeutronPhysnetNUMANodesMapping}
NeutronTunnelNUMANodes: {get_param: NeutronTunnelNUMANodes}
NovaResumeGuestsStateOnHostBoot: {get_param: NovaResumeGuestsStateOnHostBoot}

+ 10
- 0
releasenotes/notes/NovaReservedHugePages-35a13e828bfc92e9.yaml View File

@@ -0,0 +1,10 @@
---
features:
- |
Added the configuration option to set reserved_huge_pages.
When NovaReservedHugePages is set, "reserved_huge_pages" is set to the
value of NovaReservedHugePages. If NovaReservedHugePages is unset and
OvsDpdkSocketMemory is set, reserved_huge_pages value is calcuated from
KernelArgs and OvsDpdkSocketMemory. KernelArgs helps determine the
default huge page size used, the default is set to 2048kb and
OvsDpdkSocketMemory helps determine the number of hugepages to reserve.

Loading…
Cancel
Save