aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2017-09-15 12:16:25 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-09-15 12:16:25 +0000
commitd5a75d471da124b8e32cd4069fd3faae7bb8161a (patch)
treed1bea7027c15faa377e8fcfa3892f987ebd3ff72
parent8ce9980d09ce0f54c93479e074b9c67a7d59b092 (diff)
parentcf0406602ab0db66be1da3371c1a229e25a59237 (diff)
Merge "CI: Update hugepages configuration"
-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