feat: enable automounting of hugepages with 1GB pagesize if the karg hugepagesz=1G is present (#425)

This commit is contained in:
HikariKnight 2023-10-13 19:44:10 +02:00 committed by GitHub
parent 922efd7d8b
commit 24b3a66f36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 0 deletions

View File

@ -283,6 +283,7 @@ RUN /tmp/image-info.sh && \
systemctl enable ublue-update.timer && \
systemctl enable bazzite-hardware-setup.service && \
systemctl enable tailscaled.service && \
systemctl enable dev-hugepages1G.mount && \
systemctl --global enable bazzite-user-setup.service && \
if grep -q "kinoite" <<< "${BASE_IMAGE_NAME}"; then \
sed -i '/^PRETTY_NAME/s/Kinoite/Bazzite/' /usr/lib/os-release && \

View File

@ -0,0 +1,31 @@
# This file is a modified version of dev-hugepages.mount from systemd.
#
# With this unit file enabled you can set 1GB hugepages using kernel args
# and have them auto mounted, just as you would with 2MB hugepages.
#
# For normal systems use "hugepagesz=1G hugepages=16"
# to allocate 16 hugepages with a pagesize of 1GB
#
# For systems with numa nodes use "hugepagesz=1G hugepages=0:16"
# to allocate 16 hugepages on numa node 0 with a pagesize of 1GB
#
# For more info, consult the kernel.org documentation linked in this file
[Unit]
Description=1GB Huge Pages File System
Documentation=https://docs.kernel.org/admin-guide/mm/hugetlbpage.html
Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
ConditionPathExists=/sys/kernel/mm/hugepages
DefaultDependencies=no
ConditionCapability=CAP_SYS_ADMIN
ConditionVirtualization=!private-users
ConditionKernelCommandLine=hugepagesz=1G
[Install]
WantedBy=multi-user.target
[Mount]
What=hugetlbfs
Where=/dev/hugepages1G
Type=hugetlbfs
Options=pagesize=1G