summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2017-09-15 12:16:04 +0100
committerMartin Klozik <martinx.klozik@intel.com>2017-09-15 12:50:40 +0100
commitcf0406602ab0db66be1da3371c1a229e25a59237 (patch)
tree0eb5c7067dbcc1f41d85679c704027d1220b4ea9
parentf655cdd4db0fed301339be0ae8a9063807095ba5 (diff)
CI: Update hugepages configuration
Use the number of free hugepages to correctly set hugepages configuration. Limit the number of allocated hugepages to avoid memory exhaustion. Change-Id: Id5239200579f8c43706ffcc769e4963280b9eb2b Signed-off-by: Martin Klozik <martinx.klozik@intel.com>
-rwxr-xr-xci/build-vsperf.sh22
1 files changed, 20 insertions, 2 deletions
diff --git a/ci/build-vsperf.sh b/ci/build-vsperf.sh
index cee0e525..eaab9977 100755
--- a/ci/build-vsperf.sh
+++ b/ci/build-vsperf.sh
@@ -422,8 +422,22 @@ function dependencies_check() {
# configure hugepages
function configure_hugepages() {
- sudo bash -c "echo 2048 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages"
- sudo bash -c "echo 0 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages"
+ HP_MAX=8192
+ HP_REQUESTED=2048
+ HP_NR=`cat /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages`
+ HP_FREE=`cat /sys/devices/system/node/node0/hugepages/hugepages-2048kB/free_hugepages`
+ # check if HP must be (re)configured
+ if [ $HP_FREE -lt $HP_REQUESTED ] ; then
+ HP_NR_NEW=$(($HP_NR+($HP_REQUESTED-$HP_FREE)))
+ if [ $HP_NR_NEW -gt $HP_MAX ] ; then
+ HP_NR_NEW=$HP_MAX
+ fi
+ sudo bash -c "echo $HP_NR_NEW > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages"
+ fi
+
+ if [ -f /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages ] ; then
+ sudo bash -c "echo 0 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages"
+ fi
}
# dump hugepages configuration
@@ -464,7 +478,11 @@ dependencies_check
initialize_logdir
# configure hugepages
+echo "Configure hugepages"
+echo "==================="
configure_hugepages
+hugepages_info | grep -v '^--'
+echo
# execute job based on passed parameter
case $1 in