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

qcontainer.py: add new support to the parameter #3785

Merged
merged 5 commits into from
Mar 20, 2024

Conversation

nickzhq
Copy link
Contributor

@nickzhq nickzhq commented Oct 23, 2023

qdevices.py: add new support to the parameter

Add new support to the parameter: iothread_vqs_mapping.

@nickzhq nickzhq marked this pull request as draft October 23, 2023 06:14
@nickzhq
Copy link
Contributor Author

nickzhq commented Oct 23, 2023

After installing the first commit, here 's result:

add some params in cfg:
num_queues = 5
iothreads = iothread0 iothread1 iothread2
iothread_vqs_mapping = iothread0 iothread1 iothread2

output in log:
[stdlog] -object '{"qom-type": "iothread", "id": "iothread0"}'
[stdlog] -object '{"qom-type": "iothread", "id": "iothread1"}'
[stdlog] -object '{"qom-type": "iothread", "id": "iothread2"}'
[stdlog] -object '{"qom-type": "throttle-group", "id": "group1"}'
[stdlog] -device '{"id": "pcie-root-port-2", "port": 2, "driver": "pcie-root-port", "addr": "0x1.0x2", "bus": "pcie.0", "chassis": 3}'
[stdlog] -device '{"id": "virtio_scsi_pci0", "driver": "virtio-scsi-pci", "num_queues": 5, "iothread_vqs_mapping": [{"iothread": "iothread0"}, {"iothread": "iothread1"}, {"iothread": "iothread2"}], "bus": "pcie-root-port-2", "addr": "0x0"}'
[stdlog] -blockdev '{"node-name": "file_image1", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/rhel930-64-virtio-scsi.qcow2", "cache": {"direct": true, "no-flush": false}}'
[stdlog] -blockdev '{"node-name": "drive_image1", "driver": "qcow2", "read-only": false, "cache": {"direct": true, "no-flush": false}, "file": "file_image1"}'
[stdlog] -device '{"driver": "scsi-hd", "id": "image1", "drive": "drive_image1", "write-cache": "on"}'

@nickzhq nickzhq force-pushed the multi_queue branch 3 times, most recently from 306aa6b to e7ea4e2 Compare October 25, 2023 10:31
@nickzhq nickzhq marked this pull request as ready for review October 25, 2023 10:32
@nickzhq nickzhq force-pushed the multi_queue branch 6 times, most recently from 2eec422 to 5594759 Compare October 25, 2023 11:46
@nickzhq
Copy link
Contributor Author

nickzhq commented Oct 25, 2023

After the second commit:

add some params in cfg:
num_queues = 5
iothreads = iothread0 iothread1 iothread2
iothread_scheme = roundrobin:2

output in log:
-object '{"qom-type": "iothread", "id": "iothread0"}'
-object '{"qom-type": "iothread", "id": "iothread1"}'
-object '{"qom-type": "iothread", "id": "iothread2"}'
-object '{"qom-type": "throttle-group", "id": "group1"}'
-device '{"id": "pcie-root-port-2", "port": 2, "driver": "pcie-root-port", "addr": "0x1.0x2", "bus": "pcie.0", "chassis": 3}'
-device '{"id": "virtio_scsi_pci0", "driver": "virtio-scsi-pci", "num_queues": 5, "bus": "pcie-root-port-2", "addr": "0x0", "iothread_vqs_mapping": [{"iothread": "iothread0"}, {"iothread": "iothread1"}]}'
-blockdev '{"node-name": "file_image1", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/rhel930-64-virtio-scsi.qcow2", "cache": {"direct": true, "no-flush": false}}' \

if add the following parameters at the cfg:
num_queues = 5
iothreads = iothread0 iothread1 iothread2
image_iothread = iothread0
#iothread_scheme = roundrobin:2
iothread_vqs_mapping = iothread0 iothread1 iothread2

the output in log is as the following:
-object '{"qom-type": "iothread", "id": "iothread0"}'
-object '{"qom-type": "iothread", "id": "iothread1"}'
-object '{"qom-type": "iothread", "id": "iothread2"}'
-object '{"qom-type": "throttle-group", "id": "group1"}'
-device '{"id": "pcie-root-port-2", "port": 2, "driver": "pcie-root-port", "addr": "0x1.0x2", "bus": "pcie.0", "chassis": 3}'
-device '{"id": "virtio_scsi_pci0", "driver": "virtio-scsi-pci", "num_queues": 5, "iothread_vqs_mapping": [{"iothread": "iothread0"}, {"iothread": "iothread1"}, {"iothread": "iothread2"}], "bus": "pcie-root-port-2", "addr": "0x0", "iothread": "iothread0"}'

@nickzhq
Copy link
Contributor Author

nickzhq commented Oct 25, 2023

@luckyh @zhencliu @YongxueHong @qingwangrh @aliang123 @XueqiangWei
The 'multi queue support' development has been done. Please take a look, thanks!

virttest/qemu_vm.py Outdated Show resolved Hide resolved
virttest/vt_iothread.py Outdated Show resolved Hide resolved
virttest/vt_iothread.py Outdated Show resolved Hide resolved
virttest/vt_iothread.py Outdated Show resolved Hide resolved
virttest/vt_iothread.py Outdated Show resolved Hide resolved
virttest/qemu_devices/qcontainer.py Outdated Show resolved Hide resolved
virttest/qemu_devices/qcontainer.py Outdated Show resolved Hide resolved
virttest/qemu_devices/qcontainer.py Outdated Show resolved Hide resolved
virttest/qemu_devices/qdevices.py Outdated Show resolved Hide resolved
@qingwangrh
Copy link
Contributor

{noformat}

  • block_iothread_test:
    type = block_iothread_test
    data_image="stg1 stg2"
    images += " ${data_image}"
    blk_extra_params_stg1 += ",serial=stg1"
    image_name_stg1 = images/stg1
    image_size_stg1 = 1G
    remove_image_stg1 = yes
    force_create_image_stg1 = yes
    drive_format_stg1 = scsi-hd
    drive_format_stg2 = virtio
    blk_extra_params_stg2 += ",serial=stg2"
    image_name_stg2 = images/stg2
    image_size_stg2 = 1G
    remove_image_stg2 = yes
    force_create_image_stg2 = yes
    vcpu = 8
    iothreads = t1 t2 t3 t4
    num_queues_stg2 = 6
    variants:
    - with_legacy:
    iothread_scheme ?=
    image_iothread_stg2 = t1
    image_iothread_stg2 = t4
    - with_vq_mapping:
    iothread_scheme ?=
    iothread_vqs_mapping_stg1 = t2 t3
    iothread_vqs_mapping_stg2 = t1:0,1,2 t2:3 t4:5,6
    - default_vq_mapping:
    iothread_scheme = new_roundrobin
    - default:

    python ConfigTest.py --testcase=block_iothread_test --iothread_scheme=roundrobin --nr_iothreads=2 --platform=x86_64 --guestname=RHEL.9.4.0 --driveformat=virtio_scsi --imageformat=qcow2 --machines=i440fx --customsparams="vm_mem_limit = 12G\nimage_aio=threads" --firmware=default_bios --netdst=virbr0 --clone=no

(1/4) Host_RHEL.m9.u4.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.block_iothread_test.with_legacy: STARTED
(1/4) Host_RHEL.m9.u4.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.block_iothread_test.with_legacy: ERROR: VM 'avocado-vt-vm1' failed to start: Error occurred while executing make_create_command(). Check the log for traceback. (8.08 s)
(2/4) Host_RHEL.m9.u4.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.block_iothread_test.with_vq_mapping: STARTED
(2/4) Host_RHEL.m9.u4.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.block_iothread_test.with_vq_mapping: ERROR: VM 'avocado-vt-vm1' failed to start: Error occurred while executing make_create_command(). Check the log for traceback. (7.45 s)
(3/4) Host_RHEL.m9.u4.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.block_iothread_test.default_vq_mapping: STARTED
(3/4) Host_RHEL.m9.u4.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.block_iothread_test.default_vq_mapping: ERROR: VM 'avocado-vt-vm1' failed to start: Error occurred while executing make_create_command(). Check the log for traceback. (7.49 s)
(4/4) Host_RHEL.m9.u4.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.block_iothread_test.default: STARTED
(4/4) Host_RHEL.m9.u4.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.block_iothread_test.default: PASS (70.18 s)

@nickzhq nickzhq force-pushed the multi_queue branch 2 times, most recently from 06c658d to 258c963 Compare November 14, 2023 05:50
@nickzhq nickzhq force-pushed the multi_queue branch 2 times, most recently from 99d11d9 to dd6ae2d Compare March 13, 2024 05:46
@nickzhq
Copy link
Contributor Author

nickzhq commented Mar 13, 2024

(1/1) Host_RHEL.m9.u4.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.block_iothread_test.roundrobin_vq_mapping.q35: STARTED
(1/1) Host_RHEL.m9.u4.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.block_iothread_test.roundrobin_vq_mapping.q35: PASS (67.55 s)
RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0

The patch has been updated and case testing is pass.
cc @YongxueHong

@nickzhq nickzhq force-pushed the multi_queue branch 4 times, most recently from 493c7d8 to 841118c Compare March 13, 2024 06:39
@YongxueHong YongxueHong requested a review from aliang123 March 14, 2024 01:55
@nickzhq
Copy link
Contributor Author

nickzhq commented Mar 14, 2024

(1/1) Host_RHEL.m9.u4.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.block_iothread_test.roundrobin_vq_mapping.q35: STARTED (1/1) Host_RHEL.m9.u4.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.block_iothread_test.roundrobin_vq_mapping.q35: PASS (67.55 s) RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0

The patch has been updated and case testing is pass. cc @YongxueHong

@qingwangrh @aliang123 @hellohellenmao Please take a look, thanks!

@nickzhq
Copy link
Contributor Author

nickzhq commented Mar 18, 2024

Hello @qingwangrh @aliang123 @hellohellenmao, please take a check, thanks!

virttest/shared/cfg/base.cfg Outdated Show resolved Hide resolved
virttest/shared/cfg/base.cfg Outdated Show resolved Hide resolved
virttest/qemu_vm.py Outdated Show resolved Hide resolved
virttest/qemu_vm.py Outdated Show resolved Hide resolved
nickzhq added 2 commits March 19, 2024 10:30
add QIOThreadVQbus.

Signed-off-by: Houqi (Nick) Zuo <[email protected]>
Add new support to the parameters: iothread_vqs_mapping.

Signed-off-by: Houqi (Nick) Zuo <[email protected]>
@nickzhq
Copy link
Contributor Author

nickzhq commented Mar 19, 2024

@YongxueHong Please check again, thanks!

@aliang123
Copy link
Contributor

For iothread_scheme=multipeerroundrobin:5
(1/1) Host_RHEL.m9.ux.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.RHEL.9.x86_64.io-github-autotest-qemu.blockdev_mirror_multiple_blocks.q35: PASS (309.02 s)
For three disks scenario:
disk1: "iothread-vq-mapping": [{"iothread": "iothread0"}, {"iothread": "iothread3"}]}
disk2: "iothread-vq-mapping": [{"iothread": "iothread1"}, {"iothread": "iothread4"}]
disk3: "iothread-vq-mapping": [{"iothread": "iothread2"}]

For iothread_scheme=full
(1/1) Host_RHEL.m9.ux.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.RHEL.9.x.0.x86_64.io-github-autotest-qemu.blockdev_mirror_multiple_blocks.q35: PASS (309.02 s)
For three disks, bind 3 iothreads for every disk, like:
"iothread-vq-mapping": [{"iothread": "iothread0"}, {"iothread": "iothread1"}, {"iothread": "iothread2"}]

Copy link
Contributor

@aliang123 aliang123 left a comment

Choose a reason for hiding this comment

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

As the latest comment, the patch meet all the requirement from my side, ack it.

@qingwangrh
Copy link
Contributor

qingwangrh commented Mar 19, 2024

@nickzhq please check the disk number > iothread number in multipeerroundrobin scheme .
example : 4 disks 2 iothreads
It looks like some disks miss the iothread

virttest/qemu_vm.py Show resolved Hide resolved
virttest/qemu_vm.py Show resolved Hide resolved
virttest/qemu_vm.py Show resolved Hide resolved
nickzhq added 3 commits March 19, 2024 19:25
Add new support to the parameter: iothread_scheme.

Signed-off-by: Houqi (Nick) Zuo <[email protected]>
Add new support to the parameter: iothread_scheme.

Signed-off-by: Houqi (Nick) Zuo <[email protected]>
implement the iothread scheme.

Signed-off-by: Houqi (Nick) Zuo <[email protected]>
@nickzhq
Copy link
Contributor Author

nickzhq commented Mar 19, 2024

@nickzhq please check the disk number > iothread number in multipeerroundrobin scheme . example : 4 disks 2 iothreads It looks like some disks miss the iothread

Code have been updated! Please test again, thanks! @qingwangrh

cc @YongxueHong @zhencliu @aliang123 @hellohellenmao

@qingwangrh
Copy link
Contributor

Pass test
python ConfigTest.py --category=virtual_block_device_sanity --guestname=RHEL.9.4.0 --driveformat=virtio_blk --firmware=default_bios --iothread_scheme=multipeerroundrobin:2 --clone=no

LGTM

@YongxueHong
Copy link
Contributor

Thanks all, let's merge it.

@YongxueHong YongxueHong merged commit 26b8e68 into avocado-framework:master Mar 20, 2024
50 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.

5 participants