From b5fb744828293775d74ecba15cb9e5b989c5552e Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 4 Feb 2021 16:22:55 +0000 Subject: [PATCH] docs: Update documentation for hugepage_size option Including a warning that the user is respsonsible for ensuring that they have sufficient pages of the specified size. Signed-off-by: Rob Bradford --- docs/memory.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/memory.md b/docs/memory.md index 1fb95b15a..7320eef59 100644 --- a/docs/memory.md +++ b/docs/memory.md @@ -15,6 +15,7 @@ struct MemoryConfig { mergeable: bool, shared: bool, hugepages: bool, + hugepage_size: Option, hotplug_method: HotplugMethod, hotplug_size: Option, hotplugged_size: Option, @@ -76,23 +77,24 @@ _Example_ --memory size=1G,shared=on ``` -### `hugepages` +### `hugepages` and `hugepage_size` -Specifies if the memory must be `mmap(2)` with `MAP_HUGETLB` and `MAP_HUGE_2MB` -flags. This performs a memory mapping relying on 2MiB pages instead of the -default 4kiB pages. +Specifies if the memory must be created and `mmap(2)` with `MAP_HUGETLB` and size +flags. This performs a memory mapping relying on the specified huge page size. If no huge page size is supplied the system's default huge page size is used. By using hugepages, one can improve the overall performance of the VM, assuming the guest will allocate hugepages as well. Another interesting use case is VFIO as it speeds up the VM's boot time since the amount of IOMMU mappings are reduced. +The user is responsible for ensuring there are sufficient huge pages of the specified size for the VMM to use. Failure to do so may result in strange VMM behaviour. + By default this option is turned off. _Example_ ``` ---memory size=1G,hugepages=on +--memory size=1G,hugepages=on,hugepage_size=2M ``` ### `hotplug_method`