Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable auto mounting of hugepages with 1GB pagesize if karg exists #425

Merged
merged 1 commit into from
Oct 13, 2023
Merged

feat: enable auto mounting of hugepages with 1GB pagesize if karg exists #425

merged 1 commit into from
Oct 13, 2023

Conversation

HikariKnight
Copy link
Member

@HikariKnight HikariKnight commented Oct 12, 2023

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 the 16 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

<memoryBacking>
  <hugepages>
    <page size="1048576" unit="KiB"/>
  </hugepages>
</memoryBacking>

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

<memoryBacking>
  <hugepages>
    <page size="1048576" unit="KiB" nodeset="1"/>
  </hugepages>
</memoryBacking>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants