-
Notifications
You must be signed in to change notification settings - Fork 168
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
Memory : Fix incorrect block size on arm #5227
Conversation
b18852a
to
bf45690
Compare
plz provide test results on arm and x86_64, thanks! |
if params.get("start_vm") == "yes": | ||
time.sleep(30) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I ask why we need to sleep 30s for a running vm here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This portion of the code was actually not required. Sorry for the confusion.
|
||
test.log.info("TEST_STEP1: Attach a virtio-mem device.") | ||
options = '' if vm.is_alive() else '--config' | ||
virsh.attach_device(vm_name, mem_device.xml, flagstr=options, | ||
debug=True, ignore_status=False) | ||
time.sleep(30) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do all test scenarios need to wait 30s?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, Just did some checks in depth. It is only required for hot_plug test case and that too minimum sleep time required is 10s. So updated this one as well
if params.get("start_vm") == "yes": | ||
time.sleep(30) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you plz explain why we need to wait 30s here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This portion of the code was actually not required. Sorry for the confusion.
mem_device_attrs = {'mem_model': 'virtio-mem', 'target': {'requested_unit': 'KiB', 'size': 262144, 'node': 0, 'size_unit': 'KiB', 'requested_size': 131072, 'block_unit': 'KiB', 'block_size': 2048}, 'source': {'pagesize_unit': 'KiB', 'pagesize': 2048, 'nodemask': '0'}} | ||
mem_device_attrs = {'mem_model': 'virtio-mem', 'target': {'requested_unit': 'KiB', 'size': 1048576, 'node': 0, 'size_unit': 'KiB', 'requested_size': 524288, 'block_unit': 'KiB', 'block_size': 52488}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if 52488 works on x86_64 arch, plz upload test results on both x86_64 and aarch.
If it does not work, plz keep the original mem_device_attrs values for x84_64 arch, thx!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the value should be 524288 there was a typo and it is fixed now. Also uploaded the test results for both arm and x86_64 in the comment. Added the original value of mem_device_attrs for x86_64.
mem_device_attrs = {'mem_model': 'virtio-mem', 'target': {'requested_unit': 'KiB', 'size': 262144, 'node': 0, 'size_unit': 'KiB', 'requested_size': 131072, 'block_unit': 'KiB', 'block_size': 2048}, 'source': {'pagesize_unit': 'KiB', 'pagesize': 2048, 'nodemask': '0'}} | ||
requested_size = 160MiB | ||
mem_device_attrs = {'mem_model': 'virtio-mem', 'target': {'requested_unit': 'KiB', 'size': 1048576, 'node': 0, 'size_unit': 'KiB', 'requested_size': 524288, 'block_unit': 'KiB', 'block_size': 524288}} | ||
requested_size = 1048576KiB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked on the x86_64 machine and here this doesn't require the original values. On multiple checking the tests passed on both the system without any modification.
72ca7bf
to
432066b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 88-89 and 114-115 were changed when used the inspekt tool for checking style and indent
Please wrap the body of your commit at 72 characters. Others LGTM. |
beba576
to
c9d41cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@Aakanksha0311 Please pay attention to the sensitive information, like user name, machine name and so on. We need to avoid above information included in the upstream PR description and comments. Thanks. |
@Aakanksha0311 For your testing result, we'd better keep them simple. And please also include your libvirt upstream version, For example,
|
@Aakanksha0311 For a pr to fix a failure, usually our pr title is recommended like this: And please also include the failure message before your fix. Usually we write like below: Before the fix: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Others LGTM
@@ -7,6 +7,7 @@ | |||
from virttest.staging import utils_memory | |||
from virttest.utils_libvirt import libvirt_vmxml | |||
from virttest.utils_version import VersionInterval | |||
import time | |||
|
|||
VIRSH_ARGS = {'debug': True, 'ignore_status': False} | |||
ORG_HP = utils_memory.get_num_huge_pages() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are sure this case does not need hugepage setting, please also remove this line because there is no referrence in the codes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, removed.
@@ -59,10 +59,6 @@ def setup_test_virtio_mem(): | |||
""" | |||
Setup vmxml for test | |||
""" | |||
set_num_huge_pages = params.get("set_num_huge_pages") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also remove line 13 ORG_HP = utils_memory.get_num_huge_pages()
because there is not referrence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, done removed the line.
Ok, understood. Will update according to this. Thanks. |
Ok, got it. |
Oh okay thanks will be careful and update here as well. Thanks. |
27fddb4
to
1738e65
Compare
1738e65
to
5719594
Compare
Fix memory device attachment and update errors. The block size was too small, requiring a minimum of 524288KiB.This commit corrects the issue, allowing successful memory device attachment and updates. Signed-off-by: Aakanksha Tripathi <[email protected]>
5719594
to
869c29e
Compare
Sorry, I forgot to submit my approval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
Fix memory device attachment and update errors.
The block size was too small, requiring a minimum of 524288KiB.
This commit corrects the issue, allowing successful memory device
attachment and updates.
Tested with libvirt version 9.5.0
Results for x86_64
avocado run --vt-type libvirt --test-runner=runner --vt-machine-type q35 memory_update_device.virtio_mem --vt-connect-uri qemu:///system
JOB ID : 270d985bae570287fd62983eeb9c661b13e36868
JOB LOG : /var/lib/avocado/job-results/job-2023-10-23T03.12-270d985/job.log
(1/1) type_specific.io-github-autotest-libvirt.memory_update_device.virtio_mem: PASS (89.62 s)
RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML : /var/lib/avocado/job-results/job-2023-10-23T03.12-270d985/results.html
JOB TIME : 91.62 s
avocado run --vt-type libvirt --test-runner=runner --vt-machine-type q35 memory_attach_device.virtio_mem.cold_plug --vt-connect-uri qemu:///system
JOB ID : 1b475552a9fee4f0efbc0acab56d2fe4559e591b
JOB LOG : /var/lib/avocado/job-results/job-2023-10-23T03.18-1b47555/job.log
(1/1) type_specific.io-github-autotest-libvirt.memory_attach_device.virtio_mem.cold_plug: PASS (87.82 s)
RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML : /var/lib/avocado/job-results/job-2023-10-23T03.18-1b47555/results.html
JOB TIME : 89.61 s
avocado run --vt-type libvirt --test-runner=runner --vt-machine-type q35 memory_attach_device.virtio_mem.hot_plug --vt-connect-uri qemu:///system
JOB ID : 263d277e5fda66ccae8324a75e4eaf8eedb9e542
JOB LOG : /var/lib/avocado/job-results/job-2023-10-23T03.21-263d277/job.log
(1/1) type_specific.io-github-autotest-libvirt.memory_attach_device.virtio_mem.hot_plug: PASS (83.21 s)
RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML : /var/lib/avocado/job-results/job-2023-10-23T03.21-263d277/results.html
JOB TIME : 84.92 s
Results for aarch64:
avocado run --vt-type libvirt --test-runner=runner --vt-machine-type arm64-mmio memory_update_device.virtio_mem --vt-connect-uri qemu:///system
Before fix:
(1/1) type_specific.io-github-autotest-libvirt.memory_update_device.virtio_mem: ERROR: Command '/bin/virsh attach-device avocado-vt-vm1 /tmp/xml_utils_temp_qwvfgzbw.xml --config' failed.\nstdout: b'\n'\nstderr: b'error: Failed to attach device from /tmp/xml_utils_temp_qwvfgzbw.xml\nerror: block size too small, must be at least 524288KiB\n'\nad... (49.79 s)
After fix:
(1/1) type_specific.io-github-autotest-libvirt.memory_update_device.virtio_mem: PASS (87.76 s)
avocado run --vt-type libvirt --test-runner=runner --vt-machine-type arm64-mmio memory_attach_device.virtio_mem.cold_plug --vt-connect-uri qemu:///system
Before fix:
(1/1) type_specific.io-github-autotest-libvirt.memory_attach_device.virtio_mem.cold_plug: ERROR: Command '/usr/bin/virsh attach-device avocado-vt-vm1 /tmp/xml_utils_temp_6p00k16z.xml --config' failed.\nstdout: b'\n'\nstderr: b'error: Failed to attach device from /tmp/xml_utils_temp_6p00k16z.xml\nerror: block size too small, must be at least 524288KiB\n... (64.57 s)
After fix:
(1/1) type_specific.io-github-autotest-libvirt.memory_attach_device.virtio_mem.cold_plug: PASS (97.48 s)
avocado run --vt-type libvirt --test-runner=runner --vt-machine-type arm64-mmio memory_attach_device.virtio_mem.hot_plug --vt-connect-uri qemu:///system
Before fix:
(1/1) type_specific.io-github-autotest-libvirt.memory_attach_device.virtio_mem.hot_plug: ERROR: Command '/bin/virsh attach-device avocado-vt-vm1 /tmp/xml_utils_temp_09c3brgk.xml ' failed.\nstdout: b'\n'\nstderr: b'error: Failed to attach device from /tmp/xml_utils_temp_09c3brgk.xml\nerror: block size too small, must be at least 524288KiB\n'\nadditional... (112.82 s)
After fix:
(1/1) type_specific.io-github-autotest-libvirt.memory_attach_device.virtio_mem.hot_plug: PASS (95.58 s)