-
Notifications
You must be signed in to change notification settings - Fork 243
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
Add new parameter to support changing backend mem path #3666
Conversation
@PaulYuuu @YongxueHong @xiagao @zhenyzha could you please help me review this patch |
In brief, this PR is not related to numa/hugepage, it fixes the bug when |
Updated |
Hello @mcasquer, would you also help to review? This is a fix that |
Hello @PaulYuuu I understand this patch is meant to enable the possibility of setting a mem-path that could be no hugepage path, right? In that case seems correct, but just one thing, is |
@fbq815 can you explain your code design? |
seems we don't use test.fail in avocado-vt before, thus I keep the same behaviour in this patch and we could stop the test case in tp-qemu. Also, if there's negative test in the future, it won't be influenced by the error but fail would. |
@fbq815 Got your point, I will run some hugepage cases later using this patch and update here the results |
Test result on s390x (after removing extra memory-backend, could run this case with expected backend): |
After applying the current patch hugepage auto cases pass as expected (1/4) Host_RHEL.m9.u3.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.3.0.x86_64.io-github-autotest-qemu.hugepage_mem_stress.q35: STARTED
(1/4) Host_RHEL.m9.u3.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.3.0.x86_64.io-github-autotest-qemu.hugepage_mem_stress.q35: PASS (109.19 s)
(2/4) Host_RHEL.m9.u3.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.3.0.x86_64.io-github-autotest-qemu.hugepage_mem_stress.non_existent_mem_path.q35: STARTED
(2/4) Host_RHEL.m9.u3.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.3.0.x86_64.io-github-autotest-qemu.hugepage_mem_stress.non_existent_mem_path.q35: PASS (109.89 s)
(3/4) Host_RHEL.m9.u3.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.3.0.x86_64.io-github-autotest-qemu.hugepage_reset.q35: STARTED
(3/4) Host_RHEL.m9.u3.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.3.0.x86_64.io-github-autotest-qemu.hugepage_reset.q35: SKIP: The current hugepage size on host does not match the expected hugepage size.
(4/4) Host_RHEL.m9.u3.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.3.0.x86_64.io-github-autotest-qemu.hugepage_reset.on_numa_node.q35: STARTED
(4/4) Host_RHEL.m9.u3.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.3.0.x86_64.io-github-autotest-qemu.hugepage_reset.on_numa_node.q35: SKIP: The current hugepage size on host does not match the expected hugepage size.
RESULTS : PASS 2 | ERROR 0 | FAIL 0 | SKIP 2 | WARN 0 | INTERRUPT 0 | CANCEL 0 Doing some manual testing, I take [stdlog] -object '{"size": 16106127360, "id": "mem-machine_mem", "qom-type": "memory-backend-file"}' \
(status: 1, output: 'qemu-kvm: -object {"size": 16106127360, "id": "mem-machine_mem", "qom-type": "memory-backend-file"}: Parameter \'mem-path\' is missing') @fbq815 is this latter case supposed to work with this modifications? IIUC this patch is meant to use a non-hugepage mem-path, thanks! |
hi @mcasquer you could use "vm_mem_mem-path" to set the mem_path, then you won't need the hugepage anymore |
@fbq815 I am already using it variants:
- @default:
- non_existent_mem_path:
non_existent_point = yes
vm_mem_mem-path = "/tmp/mario"
pre_command = "mkdir -p ${vm_mem_mem-path}"
post_command = "rm -rf ${vm_mem_mem-path}" |
Hi, sorry for the late reply, you need to remove setup_hugepages =yes and add vm_mem_backend = /tmp/mario, vm_mem_mem-path is used for select the mem-path when there are multiple choices |
8a4ca4a
to
db6adee
Compare
@mcasquer I could get a PASS without setup_hugepages =yes |
@fbq815 case pass successfully using the new (1/2) Host_RHEL.m9.u3.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.3.0.x86_64.io-github-autotest-qemu.hugepage_mem_stress.q35: STARTED
(1/2) Host_RHEL.m9.u3.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.3.0.x86_64.io-github-autotest-qemu.hugepage_mem_stress.q35: PASS (132.58 s)
(2/2) Host_RHEL.m9.u3.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.3.0.x86_64.io-github-autotest-qemu.hugepage_mem_stress.non_existent_mem_path.q35: STARTED
(2/2) Host_RHEL.m9.u3.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.3.0.x86_64.io-github-autotest-qemu.hugepage_mem_stress.non_existent_mem_path.q35: PASS (155.43 s)
RESULTS : PASS 2 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0 The mem-path is setted properly in automation [stdlog] -object '{"size": 65498251264, "mem-path": "/tmp/mario", "id": "mem-machine_mem", "qom-type": "memory-backend-file"}' \ |
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
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.
Ack.
@YongxueHong could you please help me merge this patch? |
183b6a2
to
91506a7
Compare
8253461
to
2b118f0
Compare
@PaulYuuu @yanan-fu @YongxueHong please help me review this patch again |
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.
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.
Acked-by: Yanan Fu [email protected]
Memory: Add a new parameter "vm_mem_backend_path", this will controls the "mem-path" in memory object Signed-off-by: Boqiao Fu <[email protected]>
CC @xiagao |
After applying this patch, I am trying to run the hugepage_mem_stress test case including in the cfg: vm_mem_backend = "memory-backend-file"
vm_mem_backend_path = /tmp/mario
pre_command = "mkdir -p ${vm_mem_backend_path}"
post_command = "rm -rf ${vm_mem_backend_path}" And removing: setup_hugepages = yes
hugepage_path = /mnt/tmp The test suite cannot be created |
The test suite cannot be created even I didn't apply this patch on s390x, I don't think the root cause is this patch |
@mcasquer @fbq815 |
@zhenyzha I will give a try with If at this point the patch is ok, we can compare what's missing for |
@fbq815 virtio_fs_readonly test case fails after applying this patch and updating the cfg file you provided. (1/1) Host_RHEL.m9.u3.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.8.9.0.x86_64.io-github-autotest-qemu.virtio_fs_readonly.q35: STARTED
(1/1) Host_RHEL.m9.u3.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.8.9.0.x86_64.io-github-autotest-qemu.virtio_fs_readonly.q35: ERROR: VM creation command failed: 'MALLOC_PERTURB_=1 /usr/libexec/qemu-kvm -S -name \'avocado-vt-vm1\' -sandbox on -blockdev \'{"node-name": "file_ovmf_code", "driver": "file", "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd", "auto-read-only": true, "... (10.09 s) The message from debug.log (status: 1, output: 'qemu-kvm: -numa node,memdev=mem-mem1,nodeid=0: memdev=mem-mem1 is ambiguous') The root cause is that there is no memory object so the numa node reference is ambiguous, i.e. |
After trying again following @fbq815 suggestion, the qemu-kvm cmd line seems to be correct: /usr/libexec/qemu-kvm \
...
-object memory-backend-file,size=4G,mem-path=/dev/shm,share=yes,id=mem-mem1 \
... I am facing the following error in the test case execution, but it seems it is not related with the patch 2023-08-11 07:02:51,601 avocado.virttest.virt_vm ERROR| Console is not responsive. |
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
Thanks all, let's merge it. |
Memory: Add a new parameter "vm_mem_backend_path", this will controls
the "mem-path" in memory object
ID: 2187577
Signed-off-by: Boqiao Fu [email protected]