Skip to content

Commit

Permalink
Merge pull request #5918 from liang-cong-red-hat/memory_misc_hugepage…
Browse files Browse the repository at this point in the history
…_allocation_cleanup

Fail test case when huge page is not enough, and add huge page cleanup.
  • Loading branch information
chloerh authored Sep 26, 2024
2 parents df8581f + 3b51e5d commit b9aa15f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libvirt/tests/src/memory/memory_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ def _setup_mbxml():
test, pg_size=default_page_size, hp_size=pagesize, hp_list=[mount_pagesize])
vm_mem_size = vmxml.memory
hp_cfg = test_setup.HugePageConfig(params)
hp_cfg.set_kernel_hugepages(pagesize, vm_mem_size // pagesize)
hp_cfg.set_kernel_hugepages(mount_pagesize, mem_device_size // mount_pagesize)
hp_cfg.set_kernel_hugepages(pagesize, vm_mem_size // pagesize, False)
hp_cfg.set_kernel_hugepages(mount_pagesize, mem_device_size // mount_pagesize, False)
set_vmxml(vmxml, params)
_setup_mbxml()
vmxml.sync()
Expand Down Expand Up @@ -454,6 +454,9 @@ def cleanup_test_memorybacking(case):
utils_disk.umount('hugetlbfs', mount_path, 'hugetlbfs')
if os.path.exists(mount_path):
os.rmdir(mount_path)
hp_cfg = test_setup.HugePageConfig(params)
hp_cfg.set_kernel_hugepages(int(params.get('mount_pagesize')), 0)
hp_cfg.cleanup()

def run_test_edit_mem(case):
"""
Expand Down

0 comments on commit b9aa15f

Please sign in to comment.