Skip to content

Commit e8eb032

Browse files
author
Alexandre Ghiti
committed
libhugetlbfs: Add 64K page support
Note that we use a preinstalled libhugetlbfs build in /opt/libhugetlbfs/. Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
1 parent a25b6a9 commit e8eb032

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

automated/linux/libhugetlbfs/libhugetlbfs.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,19 @@ parse_output() {
6868
}
6969

7070
libhugetlbfs_setup() {
71-
mount_point="/mnt/hugetlb/"
7271
# Allocate hugepages
73-
echo 200 > /proc/sys/vm/nr_hugepages
72+
# 2M pages
73+
mount_point="/mnt/hugetlb-2M/"
74+
echo 200 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
7475
umount "${mount_point}" > /dev/null 2>&1 || true
7576
mkdir -p "${mount_point}"
76-
mount -t hugetlbfs hugetlbfs "${mount_point}"
77+
mount -t hugetlbfs hugetlbfs -o pagesize=2M "${mount_point}"
78+
# 64K pages
79+
mount_point="/mnt/hugetlb-64K/"
80+
echo 200 > /sys/kernel/mm/hugepages/hugepages-64kB/nr_hugepages
81+
umount "${mount_point}" > /dev/null 2>&1 || true
82+
mkdir -p "${mount_point}"
83+
mount -t hugetlbfs hugetlbfs -o pagesize=64kB "${mount_point}"
7784
}
7885

7986
libhugetlbfs_cleanup() {

0 commit comments

Comments
 (0)