Skip to content

Commit

Permalink
Merge pull request #6163 from liang-cong-red-hat/guest_numa_multifix_…
Browse files Browse the repository at this point in the history
…20250127

Fix two issues
  • Loading branch information
dzhengfy authored Jan 27, 2025
2 parents 2968b50 + ccdc124 commit f92306c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions libvirt/tests/src/numa/guest_numa.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def dynamic_node_replacement(params, numa_info, arch, test_obj):
key_names = ['memnode_nodeset_', 'page_nodenum_']
for param in params:
if 'numa_cells_with_memory_required' in param:
arch = platform.machine()
if 'ppc64' in arch:
if not node_list:
test_obj.cancel("No NUMA nodes available on this system to perform the test.")
Expand Down Expand Up @@ -292,6 +293,20 @@ def _update_qemu_conf():
deallocate = True
hp_cl.target_hugepages = hugepage_num
hp_cl.set_hugepages()
# for strict mode, allocate the guest numa cell again to
# make sure it has enough huge page
numa_hugepage_dict = {}
if numa_memnode and numa_memnode[0]['mode'] == 'strict':
if numa_cell:
for cell in numa_cell:
if cell['id'] == numa_memnode[0]['cellid']:
numa_hugepage_dict['node'] = numa_memnode[0]['nodeset']
numa_hugepage_dict['hp_num'] = int(
cell['memory']) // default_mem_huge_page_size
numa_hugepage_dict['hp_size'] = default_mem_huge_page_size
if numa_hugepage_dict:
hp_cl.set_node_num_huge_pages(
numa_hugepage_dict['hp_num'], numa_hugepage_dict['node'], numa_hugepage_dict['hp_size'])
if page_list:
hp_size = [h_list[p_size]['size'] for p_size in range(len(h_list))]
multi_hp_size = hp_cl.get_multi_supported_hugepage_size()
Expand Down

0 comments on commit f92306c

Please sign in to comment.