aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick
diff options
context:
space:
mode:
authorMytnyk, Volodymyr <volodymyrx.mytnyk@intel.com>2018-11-21 17:00:51 +0000
committerVolodymyr Mytnyk <volodymyrx.mytnyk@intel.com>2018-11-22 10:02:42 +0000
commit1c7a9fdfa6078494ec9c71931da6cd0df9180fd6 (patch)
treebf3fc35bfbb1ca649259b67abc436dcc607bee71 /yardstick
parent040afd6c0e656ab9aa5fa62ec0815f0f3510e5c6 (diff)
Fix hugepages calculation
JIRA: YARDSTICK-1537 Change-Id: If4e78fe49c8b248c180d5a8db3932d822b9e5f95 Signed-off-by: Mytnyk, Volodymyr <volodymyrx.mytnyk@intel.com>
Diffstat (limited to 'yardstick')
-rw-r--r--yardstick/common/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/yardstick/common/utils.py b/yardstick/common/utils.py
index 205247947..51313ef47 100644
--- a/yardstick/common/utils.py
+++ b/yardstick/common/utils.py
@@ -30,6 +30,7 @@ import subprocess
import sys
import time
import threading
+import math
import six
from flask import jsonify
@@ -505,7 +506,7 @@ def setup_hugepages(ssh_client, size_kb):
NR_HUGEPAGES_PATH = '/proc/sys/vm/nr_hugepages'
meminfo = read_meminfo(ssh_client)
hp_size_kb = int(meminfo['Hugepagesize'])
- hp_number = int(abs(size_kb / hp_size_kb))
+ hp_number = int(math.ceil(size_kb / float(hp_size_kb)))
ssh_client.execute(
'echo %s | sudo tee %s' % (hp_number, NR_HUGEPAGES_PATH))
hp = six.BytesIO()