feat: enable auto mounting of hugepages with 1GB pagesize if karg exists #425
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will enable auto mounting of hugepages with a pagesize of 1GB if the kernel argument
hugepagesz=1G
is present, which indicates the user has reserved hugepages with a pagesize of 1GB.Hugepages with a pagesize of 1GB each is used for specialized VMs (like gaming VMs) to reduce latency due to memory page lookups for the VM, the default hugepages of 2MB each page has auto mounting enabled by default , however for special VMs like a gaming VM (should the user set one up), it would be favorable to auto mount it too as a pagesize of 2MB for a VM with 16GB ram would have
16777216
memory pages for the VM compared to the16
you would get with 1GB hugepages.Alternatively the we can set the feature disabled by default and instead be enabled with a just command, in which case i will change it.
Users can consult https://docs.kernel.org/admin-guide/mm/hugetlbpage.html which is referenced in the mount unit file for more info on how to use hugepages, the libvirt VMs that will use 1GB hugepages will need it specified in their xml, otherwise they will use the normal memory pages that the rest of the system uses
normal config with the kargs
hugepagesz=1G hugepages=16
config for hugepages on a specific numa node (must be reserved with the kargs
hugepagesz=1G hugepages=1:16
to reserve 16 pages on numa node 1, as the default on systems with numa nodes is to split the hugepages equally across the nodes, which will actually increase latency