Skip to content

Commit

Permalink
Add documentation to back instance memory by hugepages
Browse files Browse the repository at this point in the history
Part of osism/issues#1195

Signed-off-by: Jan Horstmann <[email protected]>
  • Loading branch information
janhorstmann committed Dec 19, 2024
1 parent 4faf507 commit b98d08c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/guides/configuration-guide/openstack/nova.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,31 @@ to pin instance cores 0 and 1.

All properties used in this section may also be set on images to indicate that instances should use the specified mixed or dedicated cores or isolated emulator threads. Note however that properties set on flavors take precedence.

## Back instance memory by hugepages

Qemu/KVM can make use of hugepages, which reduces the required number of TLB entries for the instances memory. Thus it will reduce the number TLB misses, which will result in faster memory access inside the instance.
As with [dedicated cores](#dedicated-cores-for-instances) usage will enable NUMA topologies and require the [NUMA topology filter to be added to the nova-scheduler's enabled filters](#add-numa-topology-filter-to-nova-scheduler).
Since allocating hugepages requires contiguous regions of memory it is advisable to do so at boot time, by [specifying the required size and number of hugepages on the kernel cmdline](https://docs.kernel.org/admin-guide/mm/hugetlbpage.html).

If you have configured dedicated cores, make sure to configure a matching hugepage reservation by NUMA node.
E.g. assuming a compute node with two NUMA nodes of 32GB where some cores and 8GB of 4k memory pages on the first NUMA node are reserved for the hypervisor services, while the rest should be used as hugepage-backed instance memory, the following cmdline could be used: `default_hugepagesz=1G transparent_hugepage=never hugepagesz=1G hugepages=0:24,1:32`
This would set a default hugepage size of 1GB, turn off [transparent hugepages](https://docs.kernel.org/admin-guide/mm/transhuge.html), and reserve 24 1GB hugepages on NUMA node 0 and 32 1GB hugepages on NUMA node 1.
Depending on the OS this could be appended to the `GRUB_CMDLINE_LINUX` in `/etc/default/grub` followed by running

```
update-grub
```

and rebooting the node.

If you require hugepages for services on the compute node, make sure to configure nova to reserve them for the host by setting [DEFAULT.reserved_huge_pages](https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.reserved_huge_pages) accordingly.

To back an instance's memory by hugepages add the property `hw:mem_page_size=large` to a flavor and create the instance from it, e.g.:

```
openstack flavor set --property hw:mem_page_size=large $FLAVOR_NAME
```

## Local SSD storage

In this example, a local SSD is provided for use on compute node `testbed-node-0`.
Expand Down

0 comments on commit b98d08c

Please sign in to comment.