From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vr6aT-0002ao-T5 for qemu-devel@nongnu.org; Thu, 12 Dec 2013 08:46:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vr6aL-0001mG-GS for qemu-devel@nongnu.org; Thu, 12 Dec 2013 08:45:57 -0500 Date: Thu, 12 Dec 2013 14:45:40 +0100 From: Stefan Hajnoczi Message-ID: <20131212134540.GD2485@stefanha-thinkpad.redhat.com> References: <6b069e96-eeb3-4a95-8a53-076daafa7cb8@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6b069e96-eeb3-4a95-8a53-076daafa7cb8@me.com> Subject: Re: [Qemu-devel] A question about virtio inside qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yaodong Yang Cc: qemu-devel@nongnu.org, qemu-discuss@nongnu.org On Wed, Dec 11, 2013 at 08:55:33PM +0000, Yaodong Yang wrote: > I have a quick question about the virtio inside qemu. When the user application sends to a specific virtual disk a large number of read requests in a very short time, where should these requests be queued? Inside the virtqueue? virtqueue available ring or the underlying bdrv_read_aio()? Requests take up descriptor space in the vring. Remember the vring consists of 3 things: 1. Descriptor space 2. Available ring 3. Used ring While the request is pending its vring descriptors will be in use, regardless of whether the head index is in the avail/used rings. > Currently, I run one guest vm with two virtual disks (one for ubuntu system, the other is to serve the data access.) When the system is running, I can check there are for instance 50 inflight requests to read or write the system virtual disk. However, the inflight requests to the data virtual disk is always one. Which is not reasonable, because inside the vm we calculated the avery response time for each request is much larger than the time interval between two adjacent requests. I don't understand this paragraph. But virtio-blk and virtio-scsi support multiple in-flight requests. The guest should be able to achieve queue depths of around 128 with virtio-blk. > My ultimate goal is to get the number of in-flight requests for a certain virtual disk. Could someone give me some hints? Tools like iostat(1) can tell you about in-flight requests at the Linux block layer level. Stefan