未验证 提交 ec48f7e1 编写于 作者: C Cleber Rosa

Merge remote-tracking branch 'balamuruhans/hugepage_size'

Signed-off-by: NCleber Rosa <crosa@redhat.com>
...@@ -250,6 +250,18 @@ def get_page_size(): ...@@ -250,6 +250,18 @@ def get_page_size():
return int(output) return int(output)
def get_supported_huge_pages_size():
"""
Get all supported huge page sizes for this system.
:return: list of Huge pages size (kB).
"""
output = os.listdir('/sys/kernel/mm/hugepages/')
# Given the items in this directory are in the format hugepages-<size>kB,
# the <size> will always start from index 10.
return [int(each[10:].rstrip('kB')) for each in output]
def get_huge_page_size(): def get_huge_page_size():
""" """
Get size of the huge pages for this system. Get size of the huge pages for this system.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册