Skip to content

Commit

Permalink
Merge pull request #218 from orelmisan/move-huge-pages-mount
Browse files Browse the repository at this point in the history
vm-customize: Automatically mount hugepages
  • Loading branch information
RamLavi authored Jan 25, 2024
2 parents 5dc53ee + e9eabe1 commit c409d75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions vms/traffic-gen/scripts/customize-vm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ install_trex() {

# Setup hugepages in cmdline
setup_hugepages() {
mkdir -p /mnt/huge
echo "hugetlbfs /mnt/huge hugetlbfs defaults,pagesize=1GB 0 0" >> /etc/fstab

grubby --update-kernel=ALL --args="default_hugepagesz=1GB hugepagesz=1G hugepages=1"
}

Expand Down Expand Up @@ -109,9 +112,6 @@ checkup_tuned_adm_set_marker_full_path=$1
driverctl set-override 0000:06:00.0 vfio-pci
driverctl set-override 0000:07:00.0 vfio-pci
mkdir -p /mnt/huge
mount /mnt/huge --source nodev -t hugetlbfs -o pagesize=1GB
if [ ! -f "$checkup_tuned_adm_set_marker_full_path" ]; then
echo "isolated_cores=2-7" > /etc/tuned/cpu-partitioning-variables.conf
tuned-adm profile cpu-partitioning
Expand Down
6 changes: 3 additions & 3 deletions vms/vm-under-test/scripts/customize-vm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ disable_services() {

# Setup hugepages in cmdline
setup_hugepages() {
mkdir -p /mnt/huge
echo "hugetlbfs /mnt/huge hugetlbfs defaults,pagesize=1GB 0 0" >> /etc/fstab

grubby --update-kernel=ALL --args="default_hugepagesz=1GB hugepagesz=1G hugepages=1"
}

Expand Down Expand Up @@ -92,9 +95,6 @@ checkup_tuned_adm_set_marker_full_path=$1
driverctl set-override 0000:06:00.0 vfio-pci
driverctl set-override 0000:07:00.0 vfio-pci
mkdir -p /mnt/huge
mount /mnt/huge --source nodev -t hugetlbfs -o pagesize=1GB
if [ ! -f "$checkup_tuned_adm_set_marker_full_path" ]; then
echo "isolated_cores=2-7" > /etc/tuned/cpu-partitioning-variables.conf
tuned-adm profile cpu-partitioning
Expand Down

0 comments on commit c409d75

Please sign in to comment.