From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOjrM-0002eQ-UX for qemu-devel@nongnu.org; Mon, 10 Aug 2015 05:59:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZOjrG-0004sN-Me for qemu-devel@nongnu.org; Mon, 10 Aug 2015 05:59:12 -0400 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:32926) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOjrG-0004s5-FQ for qemu-devel@nongnu.org; Mon, 10 Aug 2015 05:59:06 -0400 Received: by wijp15 with SMTP id p15so128722736wij.0 for ; Mon, 10 Aug 2015 02:59:05 -0700 (PDT) Date: Mon, 10 Aug 2015 10:59:00 +0100 From: Stefan Hajnoczi Message-ID: <20150810095900.GB31433@stefanha-thinkpad.redhat.com> References: <20150810001525.6231.66973.malonedeb@gac.canonical.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EuxKj2iCbKjpUGkD" Content-Disposition: inline In-Reply-To: <20150810001525.6231.66973.malonedeb@gac.canonical.com> Subject: Re: [Qemu-devel] [Bug 1483070] [NEW] VIRTIO Sequential Write IOPS limits not working List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bug 1483070 <1483070@bugs.launchpad.net> Cc: Kevin Wolf , Peter Lieven , berto@igalia.com, qemu-devel@nongnu.org --EuxKj2iCbKjpUGkD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 10, 2015 at 12:15:25AM -0000, James Watson wrote: > IOPS limit does not work for VIRTIO devices if the disk workload is a seq= uential write. >=20 > To confirm: > IDE disk devices - the IOPS limit works fine. Disk transfer speed limit w= orks fine. > VIRTIO disk devices - the IOPS limit works fine for random IO (write/read= ) and sequential read, but not for sequential write. Disk transfer speed li= mits work fine. >=20 > Tested on Windows 7,10 and 2k12 (Fedora drivers used and here is the twis= t): > virtio-win-0.1.96 (stable) or older won't limit write IO if workload is s= equential. > virtio-win-0.1.105 (latest) or newer will limit but I have had two test m= achines crash when under high workload using IOPS limit. >=20 > For Linux: > The issue is also apparent, tested on Ubuntu 14.04 >=20 > On the hypervisor (using KVM) machine I have tried with Qemu 2.1.2 > (3.16.0-4-amd64 - Debian 8) and Qemu 2.3.0 (3.19.8-1-pve - Proxmox 3.4 > and 4) using multiple machines but all are 64bit intel. >=20 > Even though the latest VIRTIO guest drivers fix the problem, the guest > drivers shouldn't be able to ignore the limits the host puts in place or > am I missing something?? This is probably due to I/O request merging: Your benchmark application may generate 32 x 4KB write requests, but they are merged by the virtio-blk device into just 1 x 128KB write request. The merging can happen inside the guest, depending on your benchmark application and the guest kernel's I/O stack. It also happens in QEMU's virtio-blk emulation. The most recent versions of QEMU merge both read and write requests. Older versions only merged write requests. It would be more intuitive for request merging to happen after QEMU I/O throttling checks. Currently QEMU's I/O queue plug/unplug isn't advanced enough to do the request merging, so it's done earlier in the virtio-blk emulation code. I've CCed Kevin Wolf, Alberto Garcia, and Peter Lieven who may have more thoughts on this. --EuxKj2iCbKjpUGkD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVyHXkAAoJEJykq7OBq3PIdvkH/A89Da+gou7gM6E3ObKUdttN EN5bScAhfp7raR5Vah7C+gsk45s6Jx2uSucQiYWrl2xP+XxRFoKtfcxkDKZ4Ww3f OmU453diAm62FYMLIL5ZC2HG/+yJcZmvbbAbkMn592eCHFlzrR3zmTvygMoCZN7Z LA8xfQ/u/rfL8eJ8s6Y39S06VupSbUaj0Lij6/pHqXc6JPC8ZIKdxqwHhRXMujZ4 ohL12I/umA9ToUhwidtFcUZEwQq5JCpFdwthH6ut6P2rBQvYTulSIBlvlAzM8La4 pkwhRI58HzgBMTzFg8eUeRpJ1NyiTCNso1Ecw0whH74/tsICK7hrLdoYR2sx8IA= =DbKx -----END PGP SIGNATURE----- --EuxKj2iCbKjpUGkD--