From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEVY5-0005pV-PH for qemu-devel@nongnu.org; Mon, 04 Aug 2014 23:36:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEVXy-0002Oo-NW for qemu-devel@nongnu.org; Mon, 04 Aug 2014 23:36:29 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:62287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEVXy-0002Oe-J1 for qemu-devel@nongnu.org; Mon, 04 Aug 2014 23:36:22 -0400 Received: by mail-pa0-f54.google.com with SMTP id fa1so526800pad.41 for ; Mon, 04 Aug 2014 20:36:22 -0700 (PDT) From: Ming Lei Date: Tue, 5 Aug 2014 11:33:18 +0800 Message-Id: <1407209598-2572-18-git-send-email-ming.lei@canonical.com> In-Reply-To: <1407209598-2572-1-git-send-email-ming.lei@canonical.com> References: <1407209598-2572-1-git-send-email-ming.lei@canonical.com> Subject: [Qemu-devel] [PATCH v1 17/17] hw/virtio-pci: introduce num_queues property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Peter Maydell , Paolo Bonzini , Stefan Hajnoczi Cc: Kevin Wolf , Ming Lei , Fam Zheng , "Michael S. Tsirkin" 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 --- 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