* [Qemu-devel] [PATCH 2/2] block: disable I/O throttling on sync api
@ 2012-03-27 4:35 zwu.kernel
0 siblings, 0 replies; 3+ messages in thread
From: zwu.kernel @ 2012-03-27 4:35 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha, kvm, zwu.kernel, Zhi Yong Wu, pbonzini
From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
---
block.c | 6 ++++++
1 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,
qemu_iovec_init_external(&qiov, &iov, 1);
+ if (bs->io_limits_enabled) {
+ fprintf(stderr, "Disabling I/O throttling on '%s' due "
+ "to synchronous I/O.\n", bdrv_get_device_name(bs));
+ bdrv_io_limits_disable(bs);
+ }
+
if (qemu_in_coroutine()) {
/* Fast-path if already in coroutine context */
bdrv_rw_co_entry(&rwco);
--
1.7.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH 2/2] block: disable I/O throttling on sync api
@ 2012-03-27 5:56 zwu.kernel
2012-03-27 9:20 ` Stefan Hajnoczi
0 siblings, 1 reply; 3+ messages in thread
From: zwu.kernel @ 2012-03-27 5:56 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha, kvm, zwu.kernel, Zhi Yong Wu, pbonzini
From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
---
block.c | 6 ++++++
1 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,
qemu_iovec_init_external(&qiov, &iov, 1);
+ if (bs->io_limits_enabled) {
+ fprintf(stderr, "Disabling I/O throttling on '%s' due "
+ "to synchronous I/O.\n", bdrv_get_device_name(bs));
+ bdrv_io_limits_disable(bs);
+ }
+
if (qemu_in_coroutine()) {
/* Fast-path if already in coroutine context */
bdrv_rw_co_entry(&rwco);
--
1.7.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] block: disable I/O throttling on sync api
2012-03-27 5:56 [Qemu-devel] [PATCH 2/2] block: disable I/O throttling on sync api zwu.kernel
@ 2012-03-27 9:20 ` Stefan Hajnoczi
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2012-03-27 9:20 UTC (permalink / raw)
To: zwu.kernel; +Cc: kwolf, stefanha, kvm, qemu-devel, Zhi Yong Wu, pbonzini
On Tue, Mar 27, 2012 at 6:56 AM, <zwu.kernel@gmail.com> wrote:
> From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
>
> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
> ---
> block.c | 6 ++++++
> 1 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,
>
> qemu_iovec_init_external(&qiov, &iov, 1);
>
> + if (bs->io_limits_enabled) {
> + fprintf(stderr, "Disabling I/O throttling on '%s' due "
> + "to synchronous I/O.\n", bdrv_get_device_name(bs));
> + bdrv_io_limits_disable(bs);
> + }
> +
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=virtio,file=test.qed,cache=none,bps=$((4 * 1024 * 1024)),format=qed
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=virtio:
Breakpoint 1, bdrv_read (bs=0x55555643f260, sector_num=0,
buf=0x7fffffffd600 "\220\330\377\377\377\177", nb_sectors=1) at block.c:1502
1502 {
(gdb) bt
#0 bdrv_read (bs=0x55555643f260, sector_num=0,
buf=0x7fffffffd600 "\220\330\377\377\377\177", nb_sectors=1) at block.c:1502
#1 0x00005555555da188 in guess_disk_lchs (bs=0x55555643f260,
pcylinders=0x7fffffffd84c,
pheads=0x7fffffffd850, psectors=0x7fffffffd854) at block.c:1995
#2 0x00005555555da327 in bdrv_guess_geometry (bs=0x55555643f260,
pcyls=0x7fffffffd8ac,
pheads=0x7fffffffd8b0, psecs=0x7fffffffd8b4) at block.c:2042
#3 0x00005555557e4964 in virtio_blk_init (dev=0x5555564ea0e0,
conf=0x5555564ea650,
serial=0x5555564ea670) at /home/stefanha/qemu/hw/virtio-blk.c:608
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-03-27 9:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-27 5:56 [Qemu-devel] [PATCH 2/2] block: disable I/O throttling on sync api zwu.kernel
2012-03-27 9:20 ` Stefan Hajnoczi
-- strict thread matches above, loose matches on Subject: below --
2012-03-27 4:35 zwu.kernel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).