blob: 282e3bdc2a4202e17a6bc9eaa6ec32fa8f57277a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#!/bin/bash -x
hugepagesize=$(cat /proc/meminfo | grep Hugepagesize | awk -F " " {'print$2'})
if [ "$hugepagesize" == "2048" ]; then
pages=3000
elif [ "$hugepagesize" == "1048576" ]; then
pages=5
fi
sudo sysctl -w vm.nr_hugepages=$pages
HUGEPAGES=`sysctl -n vm.nr_hugepages`
echo "Configured hugepages: $HUGEPAGE"
if [ $HUGEPAGES != $pages ]; then
echo "Warning: Unable to get $pages hugepages, only got $HUGEPAGES. Cannot finish."
fi
|