From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCSaQ-0004A3-EF for qemu-devel@nongnu.org; Tue, 27 Mar 2012 05:21:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCSaK-0004Xd-3V for qemu-devel@nongnu.org; Tue, 27 Mar 2012 05:21:05 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:46960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCSaJ-0004X0-PD for qemu-devel@nongnu.org; Tue, 27 Mar 2012 05:21:00 -0400 Received: by lbon3 with SMTP id n3so4676006lbo.4 for ; Tue, 27 Mar 2012 02:20:55 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1332827773-32358-1-git-send-email-zwu.kernel@gmail.com> References: <1332827773-32358-1-git-send-email-zwu.kernel@gmail.com> Date: Tue, 27 Mar 2012 10:20:55 +0100 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/2] block: disable I/O throttling on sync api List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: zwu.kernel@gmail.com Cc: kwolf@redhat.com, stefanha@linux.vnet.ibm.com, kvm@vger.kernel.org, qemu-devel@nongnu.org, Zhi Yong Wu , pbonzini@redhat.com On Tue, Mar 27, 2012 at 6:56 AM, wrote: > From: Zhi Yong Wu > > Signed-off-by: Stefan Hajnoczi > Signed-off-by: Zhi Yong Wu > --- > =A0block.c | =A0 =A06 ++++++ > =A01 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/block.c b/block.c > index 1fbf4dd..5baf340 100644 > --- a/block.c > +++ b/block.c > @@ -1477,6 +1477,12 @@ static int bdrv_rw_co(BlockDriverState *bs, int64_= t sector_num, uint8_t *buf, > > =A0 =A0 qemu_iovec_init_external(&qiov, &iov, 1); > > + =A0 =A0if (bs->io_limits_enabled) { > + =A0 =A0 =A0 =A0fprintf(stderr, "Disabling I/O throttling on '%s' due " > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"to synchronous I/O.\n",= bdrv_get_device_name(bs)); > + =A0 =A0 =A0 =A0bdrv_io_limits_disable(bs); > + =A0 =A0} > + This patch breaks the command-line throttling options because QEMU will do synchronous I/O to the image during startup: $ x86_64-softmmu/qemu-system-x86_64 -enable-kvm -m 512 -drive if=3Dvirtio,file=3Dtest.qed,cache=3Dnone,bps=3D$((4 * 1024 * 1024)),format= =3Dqed Disabling I/O throttling on 'virtio0' due to synchronous I/O. I mentioned the geometry bdrv_read() in another email thread. Here is the backtrace - this is what causes us to disable I/O throttling even on if=3Dvirtio: Breakpoint 1, bdrv_read (bs=3D0x55555643f260, sector_num=3D0, buf=3D0x7fffffffd600 "\220\330\377\377\377\177", nb_sectors=3D1) at blo= ck.c:1502 1502 { (gdb) bt #0 bdrv_read (bs=3D0x55555643f260, sector_num=3D0, buf=3D0x7fffffffd600 "\220\330\377\377\377\177", nb_sectors=3D1) at blo= ck.c:1502 #1 0x00005555555da188 in guess_disk_lchs (bs=3D0x55555643f260, pcylinders=3D0x7fffffffd84c, pheads=3D0x7fffffffd850, psectors=3D0x7fffffffd854) at block.c:1995 #2 0x00005555555da327 in bdrv_guess_geometry (bs=3D0x55555643f260, pcyls=3D0x7fffffffd8ac, pheads=3D0x7fffffffd8b0, psecs=3D0x7fffffffd8b4) at block.c:2042 #3 0x00005555557e4964 in virtio_blk_init (dev=3D0x5555564ea0e0, conf=3D0x5555564ea650, serial=3D0x5555564ea670) at /home/stefanha/qemu/hw/virtio-blk.c:608 Stefan