qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v1 17/17] hw/virtio-pci: introduce num_queues proper


From: Ming Lei
Subject: [Qemu-devel] [PATCH v1 17/17] hw/virtio-pci: introduce num_queues property
Date: Tue, 5 Aug 2014 11:33:18 +0800

This patch introduces parameter of 'num_queues',
so that virtio-blk can support multi virt queues.

The virtio-blk multi virtqueue feature will be added to
virtio spec 1.1[1], and the 3.17 linux kernel[2] will support
the feature in virtio-blk driver. For those who wants to play
the stuff now, the kernel side patches can be found in either
Jens's block tree[3] or linux-next[4].

In my fio test over VM which is hosted on the server host,
if "num_queues" is set as 4, JOBS of fio script is set
as 4, throughout can be improved by 25% compared with
single virtqueue with any JOBS.

Compared with throughput, scalability is improved much more,
for example:
        ---------------------------------------------------
                | VM in server host, 4 virtqueues vs. 1 virtqueue
        ---------------------------------------------------
        JOBS=2  | +10%
        ---------------------------------------------------
        JOBS=4  | +78%
        ---------------------------------------------------

[1], http://marc.info/?l=linux-api&m=140486843317107&w=2
[2], http://marc.info/?l=linux-api&m=140418368421229&w=2
[3], http://git.kernel.org/cgit/linux/kernel/git/axboe/linux-block.git/ 
#for-3.17/drivers
[4], https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/

Signed-off-by: Ming Lei <address@hidden>
---
 hw/block/virtio-blk.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index baec8f8..58f8296 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -834,6 +834,7 @@ static Property virtio_blk_properties[] = {
     DEFINE_BLOCK_CHS_PROPERTIES(VirtIOBlock, blk.conf),
     DEFINE_PROP_STRING("serial", VirtIOBlock, blk.serial),
     DEFINE_PROP_BIT("config-wce", VirtIOBlock, blk.config_wce, 0, true),
+    DEFINE_PROP_UINT32("num_queues", VirtIOBlock, blk.num_queues, 1),
 #ifdef __linux__
     DEFINE_PROP_BIT("scsi", VirtIOBlock, blk.scsi, 0, true),
 #endif
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]