Skip to content

Conversation

@liang-cong-red-hat
Copy link
Contributor

Test result:
(1/6) type_specific.io-github-autotest-libvirt.memory.balloon.freepagereporting.undefined.virtio: STARTED
(1/6) type_specific.io-github-autotest-libvirt.memory.balloon.freepagereporting.undefined.virtio: PASS (63.49 s)
(2/6) type_specific.io-github-autotest-libvirt.memory.balloon.freepagereporting.undefined.virtio-non-transitional: STARTED
(2/6) type_specific.io-github-autotest-libvirt.memory.balloon.freepagereporting.undefined.virtio-non-transitional: PASS (63.52 s)
(3/6) type_specific.io-github-autotest-libvirt.memory.balloon.freepagereporting.off.virtio: STARTED
(3/6) type_specific.io-github-autotest-libvirt.memory.balloon.freepagereporting.off.virtio: PASS (63.96 s)
(4/6) type_specific.io-github-autotest-libvirt.memory.balloon.freepagereporting.off.virtio-non-transitional: STARTED
(4/6) type_specific.io-github-autotest-libvirt.memory.balloon.freepagereporting.off.virtio-non-transitional: PASS (64.64 s)
(5/6) type_specific.io-github-autotest-libvirt.memory.balloon.freepagereporting.on.virtio: STARTED
(5/6) type_specific.io-github-autotest-libvirt.memory.balloon.freepagereporting.on.virtio: PASS (63.72 s)
(6/6) type_specific.io-github-autotest-libvirt.memory.balloon.freepagereporting.on.virtio-non-transitional: STARTED
(6/6) type_specific.io-github-autotest-libvirt.memory.balloon.freepagereporting.on.virtio-non-transitional: PASS (63.63 s)

@liang-cong-red-hat
Copy link
Contributor Author

@nanli1 please help review, thx

Copy link
Contributor

@nanli1 nanli1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Others look good to me

rss_mem_thread.start()
free_mem = utils_memory.freememtotal(session)
session.cmd_status("swapoff -a")
session.cmd_status(mem_consume_cmd % (free_mem - 204800))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the 204800 not be hard value?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this consume snippet be replaced by

libvirt_memory.consume_vm_freememory(session, consume_value)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this consume snippet be replaced by

libvirt_memory.consume_vm_freememory(session, consume_value)
For I need to make sure the consume cmd executed in the guest could be finished in a fixed time, so I could record the guest memory is increased (consuming memory) and decreased (consuming cmd finished, and memory is released).
libvirt_memory.consume_vm_freememory, this func could not control the total time, the only way is to set a very big loop then it will exceed timeout 60 seconds and throw an exception.

So I use this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the 204800 not be hard value?

Done

Comment on lines +72 to +79
session.cmd_status("swapoff -a")
session.cmd_status(mem_consume_cmd % (free_mem - unconsumed_mem))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it better to check the status of these commands? What happens if they fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here the cmd is to consume guest memory which would possess more memory for qemu process. So even the cmd get stuck or timeout error the memory is consumed, that's expected, so we don't have to check the result.

@Yingshun Yingshun merged commit 178469c into autotest:master Jun 19, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants