-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathallocBigbufHugepages.sh
More file actions
executable file
·25 lines (22 loc) · 1000 Bytes
/
allocBigbufHugepages.sh
File metadata and controls
executable file
·25 lines (22 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# allocate memory to hugepages.
sudo ls > /dev/null
NUM_PAGES=9192
echo "allocating $NUM_PAGES 2MB hugepages on each socket. You may want to change this later if DPDK apps need more RAM."
echo "old number of hugepages:"
echo "node 0:"
cat /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
echo "node 1:"
cat /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
sudo su -c "echo $NUM_PAGES > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages"
sudo su -c "echo $NUM_PAGES > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages"
echo "new number of hugepages:"
echo "node 0:"
cat /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
echo "node 1:"
cat /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
# make hugepages mount dir.
mkdir -p /mnt/huge
HTLB_MOUNTED=$( mount | grep "type hugetlbfs" | wc -l)
if [ $HTLB_MOUNTED -eq 0 ]; then
mount -t hugetlbfs hugetlb /mnt/huge
fi