From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhang Haoyu Subject: Re: [question] virtio-blk performance degradation happened with virito-serial Date: Tue, 16 Sep 2014 22:59:49 +0800 Message-ID: <54185065.8090004@gmail.com> References: <201408291545282753855@sangfor.com>, <20140829143849.GA8909@grmbl.mre>, <201409012038178763909@sangfor.com>, <201409012052442706397@sangfor.com>, <5404701F.5070302@de.ibm.com>, <540470CD.9060800@redhat.com>, <5404731A.8020405@de.ibm.com>, <201409041556259426013@sangfor.com>, <540C2972.5070707@gmail.com>, <20140911061133.GG19202@grmbl.mre> <201409121121358332189@sangfor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit Cc: qemu-devel , kvm , Christian Borntraeger To: Zhang Haoyu , Amit Shah , Paolo Bonzini Return-path: Received: from mail-pa0-f50.google.com ([209.85.220.50]:58276 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753393AbaIPO7m (ORCPT ); Tue, 16 Sep 2014 10:59:42 -0400 Received: by mail-pa0-f50.google.com with SMTP id bj1so9056267pad.37 for ; Tue, 16 Sep 2014 07:59:41 -0700 (PDT) In-Reply-To: <201409121121358332189@sangfor.com> Sender: kvm-owner@vger.kernel.org List-ID: >>>>>> If virtio-blk and virtio-serial share an IRQ, the guest operating system has to check each virtqueue for activity. Maybe there is some inefficiency doing that. >>>>>> AFAIK virtio-serial registers 64 virtqueues (on 31 ports + console) even if everything is unused. >>>>> >>>>> That could be the case if MSI is disabled. >>>> >>>> Do the windows virtio drivers enable MSIs, in their inf file? >>> >>> It depends on the version of the drivers, but it is a reasonable guess >>> at what differs between Linux and Windows. Haoyu, can you give us the >>> output of lspci from a Linux guest? >>> >> I made a test with fio on rhel-6.5 guest, the same degradation happened too, this degradation can be reproduced on rhel6.5 guest 100%. >> virtio_console module installed: >> 64K-write-sequence: 285 MBPS, 4380 IOPS >> virtio_console module uninstalled: >> 64K-write-sequence: 370 MBPS, 5670 IOPS >> >I use top -d 1 -H -p to monitor the cpu usage, and found that, >virtio_console module installed: >qemu main thread cpu usage: 98% >virtio_console module uninstalled: >qemu main thread cpu usage: 60% > I found that the statement "err = register_virtio_driver(&virtio_console);" in virtio_console module's init() function will cause the degradation, if I directly return before "err = register_virtio_driver(&virtio_console);", then the degradation disappeared, if directly return after "err = register_virtio_driver(&virtio_console);", the degradation is still there. I will try below test case, 1. Dose not emulate virito-serial deivce, then install/uninstall virtio_console driver in guest, to see whether there is difference in virtio-blk performance and cpu usage. 2. Does not emulate virito-serial deivce, then install virtio_balloon driver (and also dose not emulate virtio-balloon device), to see whether virtio-blk performance degradation will happen. 3. Emulating virtio-balloon device instead of virtio-serial deivce , then to see whether the virtio-blk performance is hampered. Base on the test result, corresponding analysis will be performed. Any ideas? Thanks, Zhang Haoyu