Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numa_memory_spread: Make sure enough memory for guest #5005

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions libvirt/tests/src/numa/numa_memory_spread.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ def prepare_host_for_test(params, test):
format(numa_memory['nodeset'], nodeset_size))
logging.debug('Memory available on a neighbour node {} is {}'.
format(neighbour, nodeset_nb_size))
# Increase a size by 50% of neighbour node
oversize = int(nodeset_size + 0.5 * nodeset_nb_size)
# Increase a size by 25% of neighbour node
oversize = int(nodeset_size + 0.25 * nodeset_nb_size)
# Decrease nodeset size by 25%
undersize = int(nodeset_size * 0.25)
# Memory to eat is a whole nodeset + 10% of neighbour size
memory_to_eat = int(nodeset_size + 0.1 * nodeset_nb_size)
# Memory to eat is a whole nodeset + 5% of neighbour size
memory_to_eat = int(nodeset_size + 0.05 * nodeset_nb_size)
nodeset_string = '{},{}'.format(online_nodes[0], neighbour)
process.run("swapoff -a", shell=True)

Expand Down Expand Up @@ -246,6 +246,8 @@ def run(test, params, env):
nodeset_string = constants[5]
# Prepare VM XML
prepare_vm_xml_for_test(vm_name, numa_memory, oversize, undersize)
# Drop caches first to make sure host has enough memory
utils_memory.drop_caches()
# Start the VM
virsh.start(vm_name, ignore_status=False, debug=True)
session = vm.wait_for_login()
Expand Down