Skip to content

Commit

Permalink
Merge pull request #5827 from nanli1/add_case_for_virtio_mem_with_num…
Browse files Browse the repository at this point in the history
…a_tuning

add case for virtio mem with numa node tunning
  • Loading branch information
dzhengfy authored Oct 10, 2024
2 parents 235bde7 + eb8e356 commit 095b3c4
Show file tree
Hide file tree
Showing 3 changed files with 538 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
- memory.devices.virtio.with_numa_tuning:
no s390-virtio
type = virtio_memory_with_numa_node_tuning
start_vm = "yes"
mem_model = "virtio-mem"
allocate_huge_mem = "1048576KiB"
allocate_huge_mem_1 = "2097152KiB"
hugepage_path = "/dev/hugepages-%s"
kernel_hp_tmpl_file = "/sys/devices/system/node/node%s/hugepages/hugepages-%skB/nr_hugepages"
memory_backing_dict = "'mb': {'hugepages': {'pages': [{'size': '%s','unit': 'KiB','nodeset':'0'}]}}"
base_attrs = "'vcpu': 4, 'memory_unit':'KiB','memory':2097152,'current_mem':2097152"
numa_attrs = "'cpu': {'numa_cell': [{'id': '0', 'cpus': '0-1', 'memory': '1048576', 'unit': 'KiB'},{'id':'1','cpus': '2-3','memory':'1048576','unit':'KiB'}]}"
max_attrs = "'max_mem_rt': 15242880, 'max_mem_rt_slots': 16"
required_kernel = [5.14.0,)
guest_required_kernel = [5.8.0,)
func_supported_since_libvirt_ver = (8, 0, 0)
func_supported_since_qemu_kvm_ver = (6, 2, 0)
variants numa_tuning:
- strict:
tuning_mode = "strict"
mode_attrs = "'numa_memory': {'mode': '${tuning_mode}','nodeset': '%s'},"
memnode_mode = "interleave"
numa_memnode = "'numa_memnode':[{'cellid': '0', 'mode': '${memnode_mode}', 'nodeset': '%s'}]"
- interleave:
tuning_mode = "interleave"
mode_attrs = "'numa_memory': {'mode': '${tuning_mode}','nodeset': '%s'},"
memnode_mode = "preferred"
numa_memnode = "'numa_memnode':[{'cellid': '0', 'mode': '${memnode_mode}', 'nodeset': '%s'}]"
- preferred:
tuning_mode = "preferred"
memnode_mode = "strict"
mode_attrs = "'numa_memory': {'mode': '${tuning_mode}','nodeset': '%s'},"
numa_memnode = "'numa_memnode':[{'cellid': '0', 'mode': '${memnode_mode}', 'nodeset': '%s'}]"
- undefined:
mode_attrs = ""
numa_memnode = ""
tuning_attrs = "${mode_attrs}${numa_memnode}"
vm_attrs = {${memory_backing_dict},${base_attrs}, ${numa_attrs}, ${max_attrs}, ${tuning_attrs}}
variants case:
- with_source_virtio_mem:
request_size = 1048576
target_size = 1048576
virtio_mem_1 = {'mem_model': '${mem_model}', 'source': {'nodemask': '1', 'pagesize': %s, 'pagesize_unit': 'KiB'},'target': {'size': ${target_size}, 'node': 1, 'requested_size': ${request_size}, 'block_size': %s}}
virtio_mem_2 = {'mem_model': '${mem_model}', 'source': {'nodemask': '0', 'pagesize': %s, 'pagesize_unit': 'KiB'},'target': {'size': ${target_size}, 'node': 0, 'requested_size': ${request_size}, 'block_size': %s}}
virtio_mem_list = [${virtio_mem_1}, ${virtio_mem_2}]
- no_source_virtio_mem:
target_size_1 = 524288
kernel_extra_params_add = "memhp_default_state=online_movable"
virtio_mem_1 = {'mem_model': '${mem_model}', 'target': {'size': ${target_size_1}, 'node': 1, 'requested_size': 524288, 'block_size': %s}}
virtio_mem_2 = {'mem_model': '${mem_model}', 'target': {'size': 1048576, 'node': 0, 'requested_size': 1048576, 'block_size': %s}}
virtio_mem_list = [${virtio_mem_1}, ${virtio_mem_2}]
- requested_bigger_than_host_numa:
request_size = 2097152
target_size = 2097152
virtio_mem_list = [{'mem_model': '${mem_model}', 'target': {'size': ${target_size}, 'node': 0, 'requested_size': ${request_size}, 'block_size':%s}}]
variants operation:
- cold_plug:
attach_option = "--config"
- hot_plug:
attach_option = " "
Loading

0 comments on commit 095b3c4

Please sign in to comment.