qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate
@ 2013-04-05 19:27 Kevin Wolf
  2013-04-05 19:27 ` [Qemu-devel] [PATCH 1/4] block: Introduce bdrv_writev_vmstate Kevin Wolf
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Kevin Wolf @ 2013-04-05 19:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini, stefanha

This gives us back reasonable savevm performance, which regressed in
commit 500f0061.

Kevin Wolf (4):
  block: Introduce bdrv_writev_vmstate
  savevm: Implement block_writev_buffer()
  block: Introduce bdrv_pwritev() for qcow2_save_vmstate
  qemu-iotests: A few more bdrv_pread/pwrite tests

 block.c                       | 105 +++++++++++++++++++++++++++++++-----------
 block/qcow2.c                 |   6 +--
 block/sheepdog.c              |  13 ++++--
 include/block/block.h         |   3 ++
 include/block/block_int.h     |   4 +-
 include/migration/qemu-file.h |   2 +-
 savevm.c                      |  25 ++++++++--
 tests/qemu-iotests/002        |  13 ++++++
 tests/qemu-iotests/002.out    |  26 +++++++++++
 9 files changed, 157 insertions(+), 40 deletions(-)

-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 1/4] block: Introduce bdrv_writev_vmstate
  2013-04-05 19:27 [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate Kevin Wolf
@ 2013-04-05 19:27 ` Kevin Wolf
  2013-04-05 19:27 ` [Qemu-devel] [PATCH 2/4] savevm: Implement block_writev_buffer() Kevin Wolf
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Kevin Wolf @ 2013-04-05 19:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini, stefanha

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c                   | 25 ++++++++++++++++++++-----
 block/qcow2.c             | 12 +++++++++---
 block/sheepdog.c          | 13 ++++++++++---
 include/block/block.h     |  1 +
 include/block/block_int.h |  4 ++--
 5 files changed, 42 insertions(+), 13 deletions(-)

diff --git a/block.c b/block.c
index 0ae2e93..ab1883e 100644
--- a/block.c
+++ b/block.c
@@ -3187,13 +3187,28 @@ int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
 int bdrv_save_vmstate(BlockDriverState *bs, const uint8_t *buf,
                       int64_t pos, int size)
 {
+    QEMUIOVector qiov;
+    struct iovec iov = {
+        .iov_base   = (void *) buf,
+        .iov_len    = size,
+    };
+
+    qemu_iovec_init_external(&qiov, &iov, 1);
+    return bdrv_writev_vmstate(bs, &qiov, pos);
+}
+
+int bdrv_writev_vmstate(BlockDriverState *bs, QEMUIOVector *qiov, int64_t pos)
+{
     BlockDriver *drv = bs->drv;
-    if (!drv)
+
+    if (!drv) {
         return -ENOMEDIUM;
-    if (drv->bdrv_save_vmstate)
-        return drv->bdrv_save_vmstate(bs, buf, pos, size);
-    if (bs->file)
-        return bdrv_save_vmstate(bs->file, buf, pos, size);
+    } else if (drv->bdrv_save_vmstate) {
+        return drv->bdrv_save_vmstate(bs, qiov, pos);
+    } else if (bs->file) {
+        return bdrv_writev_vmstate(bs->file, qiov, pos);
+    }
+
     return -ENOTSUP;
 }
 
diff --git a/block/qcow2.c b/block/qcow2.c
index 7e7d775..3dff968 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1652,18 +1652,24 @@ static void dump_refcounts(BlockDriverState *bs)
 }
 #endif
 
-static int qcow2_save_vmstate(BlockDriverState *bs, const uint8_t *buf,
-                              int64_t pos, int size)
+static int qcow2_save_vmstate(BlockDriverState *bs, QEMUIOVector *qiov,
+                              int64_t pos)
 {
     BDRVQcowState *s = bs->opaque;
     int growable = bs->growable;
     int ret;
+    void *buf;
+
+    buf = qemu_blockalign(bs, qiov->size);
+    qemu_iovec_to_buf(qiov, 0, buf, qiov->size);
 
     BLKDBG_EVENT(bs->file, BLKDBG_VMSTATE_SAVE);
     bs->growable = 1;
-    ret = bdrv_pwrite(bs, qcow2_vm_state_offset(s) + pos, buf, size);
+    ret = bdrv_pwrite(bs, qcow2_vm_state_offset(s) + pos, buf, qiov->size);
     bs->growable = growable;
 
+    qemu_vfree(buf);
+
     return ret;
 }
 
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 987018e..1c5b532 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -2054,12 +2054,19 @@ cleanup:
     return ret;
 }
 
-static int sd_save_vmstate(BlockDriverState *bs, const uint8_t *data,
-                           int64_t pos, int size)
+static int sd_save_vmstate(BlockDriverState *bs, QEMUIOVector *qiov,
+                           int64_t pos)
 {
     BDRVSheepdogState *s = bs->opaque;
+    void *buf;
+    int ret;
 
-    return do_load_save_vmstate(s, (uint8_t *)data, pos, size, 0);
+    buf = qemu_blockalign(bs, qiov->size);
+    qemu_iovec_to_buf(qiov, 0, buf, qiov->size);
+    ret = do_load_save_vmstate(s, (uint8_t *) buf, pos, qiov->size, 0);
+    qemu_vfree(buf);
+
+    return ret;
 }
 
 static int sd_load_vmstate(BlockDriverState *bs, uint8_t *data,
diff --git a/include/block/block.h b/include/block/block.h
index 9dc6aad..e5fc566 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -348,6 +348,7 @@ void path_combine(char *dest, int dest_size,
                   const char *base_path,
                   const char *filename);
 
+int bdrv_writev_vmstate(BlockDriverState *bs, QEMUIOVector *qiov, int64_t pos);
 int bdrv_save_vmstate(BlockDriverState *bs, const uint8_t *buf,
                       int64_t pos, int size);
 
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 0986a2d..a709ea6 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -164,8 +164,8 @@ struct BlockDriver {
                                   const char *snapshot_name);
     int (*bdrv_get_info)(BlockDriverState *bs, BlockDriverInfo *bdi);
 
-    int (*bdrv_save_vmstate)(BlockDriverState *bs, const uint8_t *buf,
-                             int64_t pos, int size);
+    int (*bdrv_save_vmstate)(BlockDriverState *bs, QEMUIOVector *qiov,
+                             int64_t pos);
     int (*bdrv_load_vmstate)(BlockDriverState *bs, uint8_t *buf,
                              int64_t pos, int size);
 
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 2/4] savevm: Implement block_writev_buffer()
  2013-04-05 19:27 [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate Kevin Wolf
  2013-04-05 19:27 ` [Qemu-devel] [PATCH 1/4] block: Introduce bdrv_writev_vmstate Kevin Wolf
@ 2013-04-05 19:27 ` Kevin Wolf
  2013-04-05 19:27 ` [Qemu-devel] [PATCH 3/4] block: Introduce bdrv_pwritev() for qcow2_save_vmstate Kevin Wolf
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Kevin Wolf @ 2013-04-05 19:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini, stefanha

Instead of breaking up RAM state into many small chunks, pass the iovec
to the block layer for better performance.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 include/migration/qemu-file.h |  2 +-
 savevm.c                      | 25 +++++++++++++++++++++----
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/include/migration/qemu-file.h b/include/migration/qemu-file.h
index 623c434..7519464 100644
--- a/include/migration/qemu-file.h
+++ b/include/migration/qemu-file.h
@@ -55,7 +55,7 @@ typedef int (QEMUFileGetFD)(void *opaque);
  * This function writes an iovec to file.
  */
 typedef ssize_t (QEMUFileWritevBufferFunc)(void *opaque, struct iovec *iov,
-                                           int iovcnt);
+                                           int iovcnt, int64_t pos);
 
 typedef struct QEMUFileOps {
     QEMUFilePutBufferFunc *put_buffer;
diff --git a/savevm.c b/savevm.c
index b1d8988..88fe985 100644
--- a/savevm.c
+++ b/savevm.c
@@ -176,7 +176,8 @@ static void coroutine_fn yield_until_fd_readable(int fd)
     qemu_coroutine_yield();
 }
 
-static ssize_t socket_writev_buffer(void *opaque, struct iovec *iov, int iovcnt)
+static ssize_t socket_writev_buffer(void *opaque, struct iovec *iov, int iovcnt,
+                                    int64_t pos)
 {
     QEMUFileSocket *s = opaque;
     ssize_t len;
@@ -458,6 +459,21 @@ fail:
     return NULL;
 }
 
+static ssize_t block_writev_buffer(void *opaque, struct iovec *iov, int iovcnt,
+                                   int64_t pos)
+{
+    int ret;
+    QEMUIOVector qiov;
+
+    qemu_iovec_init_external(&qiov, iov, iovcnt);
+    ret = bdrv_writev_vmstate(opaque, &qiov, pos);
+    if (ret < 0) {
+        return ret;
+    }
+
+    return qiov.size;
+}
+
 static int block_put_buffer(void *opaque, const uint8_t *buf,
                            int64_t pos, int size)
 {
@@ -481,8 +497,9 @@ static const QEMUFileOps bdrv_read_ops = {
 };
 
 static const QEMUFileOps bdrv_write_ops = {
-    .put_buffer = block_put_buffer,
-    .close =      bdrv_fclose
+    .put_buffer     = block_put_buffer,
+    .writev_buffer  = block_writev_buffer,
+    .close          = bdrv_fclose
 };
 
 static QEMUFile *qemu_fopen_bdrv(BlockDriverState *bs, int is_writable)
@@ -533,7 +550,7 @@ static void qemu_fflush(QEMUFile *f)
 
     if (f->is_write && f->iovcnt > 0) {
         if (f->ops->writev_buffer) {
-            ret = f->ops->writev_buffer(f->opaque, f->iov, f->iovcnt);
+            ret = f->ops->writev_buffer(f->opaque, f->iov, f->iovcnt, f->pos);
             if (ret >= 0) {
                 f->pos += ret;
             }
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 3/4] block: Introduce bdrv_pwritev() for qcow2_save_vmstate
  2013-04-05 19:27 [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate Kevin Wolf
  2013-04-05 19:27 ` [Qemu-devel] [PATCH 1/4] block: Introduce bdrv_writev_vmstate Kevin Wolf
  2013-04-05 19:27 ` [Qemu-devel] [PATCH 2/4] savevm: Implement block_writev_buffer() Kevin Wolf
@ 2013-04-05 19:27 ` Kevin Wolf
  2013-04-05 19:27 ` [Qemu-devel] [PATCH 4/4] qemu-iotests: A few more bdrv_pread/pwrite tests Kevin Wolf
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Kevin Wolf @ 2013-04-05 19:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini, stefanha

Directly pass the QEMUIOVector on instead of linearising it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c               | 80 +++++++++++++++++++++++++++++++++++++--------------
 block/qcow2.c         |  8 +-----
 include/block/block.h |  2 ++
 3 files changed, 61 insertions(+), 29 deletions(-)

diff --git a/block.c b/block.c
index ab1883e..3777810 100644
--- a/block.c
+++ b/block.c
@@ -2134,27 +2134,21 @@ static void coroutine_fn bdrv_rw_co_entry(void *opaque)
 }
 
 /*
- * Process a synchronous request using coroutines
+ * Process a vectored synchronous request using coroutines
  */
-static int bdrv_rw_co(BlockDriverState *bs, int64_t sector_num, uint8_t *buf,
-                      int nb_sectors, bool is_write)
+static int bdrv_rwv_co(BlockDriverState *bs, int64_t sector_num,
+                       QEMUIOVector *qiov, bool is_write)
 {
-    QEMUIOVector qiov;
-    struct iovec iov = {
-        .iov_base = (void *)buf,
-        .iov_len = nb_sectors * BDRV_SECTOR_SIZE,
-    };
     Coroutine *co;
     RwCo rwco = {
         .bs = bs,
         .sector_num = sector_num,
-        .nb_sectors = nb_sectors,
-        .qiov = &qiov,
+        .nb_sectors = qiov->size >> BDRV_SECTOR_BITS,
+        .qiov = qiov,
         .is_write = is_write,
         .ret = NOT_DONE,
     };
-
-    qemu_iovec_init_external(&qiov, &iov, 1);
+    assert((qiov->size & (BDRV_SECTOR_SIZE - 1)) == 0);
 
     /**
      * In sync call context, when the vcpu is blocked, this throttling timer
@@ -2180,6 +2174,22 @@ static int bdrv_rw_co(BlockDriverState *bs, int64_t sector_num, uint8_t *buf,
     return rwco.ret;
 }
 
+/*
+ * Process a synchronous request using coroutines
+ */
+static int bdrv_rw_co(BlockDriverState *bs, int64_t sector_num, uint8_t *buf,
+                      int nb_sectors, bool is_write)
+{
+    QEMUIOVector qiov;
+    struct iovec iov = {
+        .iov_base = (void *)buf,
+        .iov_len = nb_sectors * BDRV_SECTOR_SIZE,
+    };
+
+    qemu_iovec_init_external(&qiov, &iov, 1);
+    return bdrv_rwv_co(bs, sector_num, &qiov, is_write);
+}
+
 /* return < 0 if error. See bdrv_write() for the return codes */
 int bdrv_read(BlockDriverState *bs, int64_t sector_num,
               uint8_t *buf, int nb_sectors)
@@ -2213,6 +2223,11 @@ int bdrv_write(BlockDriverState *bs, int64_t sector_num,
     return bdrv_rw_co(bs, sector_num, (uint8_t *)buf, nb_sectors, true);
 }
 
+int bdrv_writev(BlockDriverState *bs, int64_t sector_num, QEMUIOVector *qiov)
+{
+    return bdrv_rwv_co(bs, sector_num, qiov, true);
+}
+
 int bdrv_pread(BlockDriverState *bs, int64_t offset,
                void *buf, int count1)
 {
@@ -2258,15 +2273,15 @@ int bdrv_pread(BlockDriverState *bs, int64_t offset,
     return count1;
 }
 
-int bdrv_pwrite(BlockDriverState *bs, int64_t offset,
-                const void *buf, int count1)
+int bdrv_pwritev(BlockDriverState *bs, int64_t offset, QEMUIOVector *qiov)
 {
     uint8_t tmp_buf[BDRV_SECTOR_SIZE];
     int len, nb_sectors, count;
     int64_t sector_num;
     int ret;
 
-    count = count1;
+    count = qiov->size;
+
     /* first write to align to sector start */
     len = (BDRV_SECTOR_SIZE - offset) & (BDRV_SECTOR_SIZE - 1);
     if (len > count)
@@ -2275,24 +2290,32 @@ int bdrv_pwrite(BlockDriverState *bs, int64_t offset,
     if (len > 0) {
         if ((ret = bdrv_read(bs, sector_num, tmp_buf, 1)) < 0)
             return ret;
-        memcpy(tmp_buf + (offset & (BDRV_SECTOR_SIZE - 1)), buf, len);
+        qemu_iovec_to_buf(qiov, 0, tmp_buf + (offset & (BDRV_SECTOR_SIZE - 1)),
+                          len);
         if ((ret = bdrv_write(bs, sector_num, tmp_buf, 1)) < 0)
             return ret;
         count -= len;
         if (count == 0)
-            return count1;
+            return qiov->size;
         sector_num++;
-        buf += len;
     }
 
     /* write the sectors "in place" */
     nb_sectors = count >> BDRV_SECTOR_BITS;
     if (nb_sectors > 0) {
-        if ((ret = bdrv_write(bs, sector_num, buf, nb_sectors)) < 0)
+        QEMUIOVector qiov_inplace;
+
+        qemu_iovec_init(&qiov_inplace, qiov->niov);
+        qemu_iovec_concat(&qiov_inplace, qiov, len,
+                          nb_sectors << BDRV_SECTOR_BITS);
+        ret = bdrv_writev(bs, sector_num, &qiov_inplace);
+        qemu_iovec_destroy(&qiov_inplace);
+        if (ret < 0) {
             return ret;
+        }
+
         sector_num += nb_sectors;
         len = nb_sectors << BDRV_SECTOR_BITS;
-        buf += len;
         count -= len;
     }
 
@@ -2300,11 +2323,24 @@ int bdrv_pwrite(BlockDriverState *bs, int64_t offset,
     if (count > 0) {
         if ((ret = bdrv_read(bs, sector_num, tmp_buf, 1)) < 0)
             return ret;
-        memcpy(tmp_buf, buf, count);
+        qemu_iovec_to_buf(qiov, qiov->size - count, tmp_buf, count);
         if ((ret = bdrv_write(bs, sector_num, tmp_buf, 1)) < 0)
             return ret;
     }
-    return count1;
+    return qiov->size;
+}
+
+int bdrv_pwrite(BlockDriverState *bs, int64_t offset,
+                const void *buf, int count1)
+{
+    QEMUIOVector qiov;
+    struct iovec iov = {
+        .iov_base   = (void *) buf,
+        .iov_len    = count1,
+    };
+
+    qemu_iovec_init_external(&qiov, &iov, 1);
+    return bdrv_pwritev(bs, offset, &qiov);
 }
 
 /*
diff --git a/block/qcow2.c b/block/qcow2.c
index 3dff968..132ff40 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1658,18 +1658,12 @@ static int qcow2_save_vmstate(BlockDriverState *bs, QEMUIOVector *qiov,
     BDRVQcowState *s = bs->opaque;
     int growable = bs->growable;
     int ret;
-    void *buf;
-
-    buf = qemu_blockalign(bs, qiov->size);
-    qemu_iovec_to_buf(qiov, 0, buf, qiov->size);
 
     BLKDBG_EVENT(bs->file, BLKDBG_VMSTATE_SAVE);
     bs->growable = 1;
-    ret = bdrv_pwrite(bs, qcow2_vm_state_offset(s) + pos, buf, qiov->size);
+    ret = bdrv_pwritev(bs, qcow2_vm_state_offset(s) + pos, qiov);
     bs->growable = growable;
 
-    qemu_vfree(buf);
-
     return ret;
 }
 
diff --git a/include/block/block.h b/include/block/block.h
index e5fc566..ebd9512 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -166,10 +166,12 @@ int bdrv_read_unthrottled(BlockDriverState *bs, int64_t sector_num,
                           uint8_t *buf, int nb_sectors);
 int bdrv_write(BlockDriverState *bs, int64_t sector_num,
                const uint8_t *buf, int nb_sectors);
+int bdrv_writev(BlockDriverState *bs, int64_t sector_num, QEMUIOVector *qiov);
 int bdrv_pread(BlockDriverState *bs, int64_t offset,
                void *buf, int count);
 int bdrv_pwrite(BlockDriverState *bs, int64_t offset,
                 const void *buf, int count);
+int bdrv_pwritev(BlockDriverState *bs, int64_t offset, QEMUIOVector *qiov);
 int bdrv_pwrite_sync(BlockDriverState *bs, int64_t offset,
     const void *buf, int count);
 int coroutine_fn bdrv_co_readv(BlockDriverState *bs, int64_t sector_num,
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 4/4] qemu-iotests: A few more bdrv_pread/pwrite tests
  2013-04-05 19:27 [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate Kevin Wolf
                   ` (2 preceding siblings ...)
  2013-04-05 19:27 ` [Qemu-devel] [PATCH 3/4] block: Introduce bdrv_pwritev() for qcow2_save_vmstate Kevin Wolf
@ 2013-04-05 19:27 ` Kevin Wolf
  2013-04-08 16:03 ` [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate Stefan Hajnoczi
  2013-04-09 12:30 ` Stefan Hajnoczi
  5 siblings, 0 replies; 11+ messages in thread
From: Kevin Wolf @ 2013-04-05 19:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini, stefanha

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/002     | 13 +++++++++++++
 tests/qemu-iotests/002.out | 26 ++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/tests/qemu-iotests/002 b/tests/qemu-iotests/002
index bebed84..51d0a8f 100755
--- a/tests/qemu-iotests/002
+++ b/tests/qemu-iotests/002
@@ -61,10 +61,23 @@ $QEMU_IO -c "read -pP 0xa 0 $size" $TEST_IMG | _filter_qemu_io
 echo
 echo "unaligned pwrite"
 $QEMU_IO -c 'write -pP 0xab 66 42' $TEST_IMG | _filter_qemu_io
+$QEMU_IO -c 'write -pP 0xac 512 288' $TEST_IMG | _filter_qemu_io
+$QEMU_IO -c 'write -pP 0xad 800 224' $TEST_IMG | _filter_qemu_io
+$QEMU_IO -c 'write -pP 0xae 66000 128k' $TEST_IMG | _filter_qemu_io
+$QEMU_IO -c 'write -pP 0xaf 256k 42' $TEST_IMG | _filter_qemu_io
 
 echo
 echo "verify pattern"
+$QEMU_IO -c 'read -pP 0xa 0 66' $TEST_IMG | _filter_qemu_io
 $QEMU_IO -c 'read -pP 0xab 66 42' $TEST_IMG | _filter_qemu_io
+$QEMU_IO -c 'read -pP 0xa 108 404' $TEST_IMG | _filter_qemu_io
+$QEMU_IO -c 'read -pP 0xac 512 288' $TEST_IMG | _filter_qemu_io
+$QEMU_IO -c 'read -pP 0xad 800 224' $TEST_IMG | _filter_qemu_io
+$QEMU_IO -c 'read -pP 0xa 1k 64976' $TEST_IMG | _filter_qemu_io
+$QEMU_IO -c 'read -pP 0xae 66000 128k' $TEST_IMG | _filter_qemu_io
+$QEMU_IO -c 'read -pP 0xa 197072 65072' $TEST_IMG | _filter_qemu_io
+$QEMU_IO -c 'read -pP 0xaf 256k 42' $TEST_IMG | _filter_qemu_io
+$QEMU_IO -c 'read -pP 0xa 262186 470' $TEST_IMG | _filter_qemu_io
 
 # success, all done
 echo "*** done"
diff --git a/tests/qemu-iotests/002.out b/tests/qemu-iotests/002.out
index 75f5876..cd6aa0f 100644
--- a/tests/qemu-iotests/002.out
+++ b/tests/qemu-iotests/002.out
@@ -16,8 +16,34 @@ read 134217728/134217728 bytes at offset 0
 unaligned pwrite
 wrote 42/42 bytes at offset 66
 42 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 288/288 bytes at offset 512
+288 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 224/224 bytes at offset 800
+224 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 131072/131072 bytes at offset 66000
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 42/42 bytes at offset 262144
+42 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 
 verify pattern
+read 66/66 bytes at offset 0
+66 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 read 42/42 bytes at offset 66
 42 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 404/404 bytes at offset 108
+404 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 288/288 bytes at offset 512
+288 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 224/224 bytes at offset 800
+224 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 64976/64976 bytes at offset 1024
+63.453 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 131072/131072 bytes at offset 66000
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 65072/65072 bytes at offset 197072
+63.547 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 42/42 bytes at offset 262144
+42 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 470/470 bytes at offset 262186
+470 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 *** done
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate
  2013-04-05 19:27 [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate Kevin Wolf
                   ` (3 preceding siblings ...)
  2013-04-05 19:27 ` [Qemu-devel] [PATCH 4/4] qemu-iotests: A few more bdrv_pread/pwrite tests Kevin Wolf
@ 2013-04-08 16:03 ` Stefan Hajnoczi
  2013-04-08 16:18   ` Paolo Bonzini
  2013-04-09 12:30 ` Stefan Hajnoczi
  5 siblings, 1 reply; 11+ messages in thread
From: Stefan Hajnoczi @ 2013-04-08 16:03 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: pbonzini, qemu-devel, stefanha

On Fri, Apr 05, 2013 at 09:27:52PM +0200, Kevin Wolf wrote:
> This gives us back reasonable savevm performance, which regressed in
> commit 500f0061.
> 
> Kevin Wolf (4):
>   block: Introduce bdrv_writev_vmstate
>   savevm: Implement block_writev_buffer()
>   block: Introduce bdrv_pwritev() for qcow2_save_vmstate
>   qemu-iotests: A few more bdrv_pread/pwrite tests
> 
>  block.c                       | 105 +++++++++++++++++++++++++++++++-----------
>  block/qcow2.c                 |   6 +--
>  block/sheepdog.c              |  13 ++++--
>  include/block/block.h         |   3 ++
>  include/block/block_int.h     |   4 +-
>  include/migration/qemu-file.h |   2 +-
>  savevm.c                      |  25 ++++++++--
>  tests/qemu-iotests/002        |  13 ++++++
>  tests/qemu-iotests/002.out    |  26 +++++++++++
>  9 files changed, 157 insertions(+), 40 deletions(-)
> 
> -- 
> 1.8.1.4

Looks fine on the block side.  Perhaps Orit, Juan, or Paolo can
double-check the migration side.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate
  2013-04-08 16:03 ` [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate Stefan Hajnoczi
@ 2013-04-08 16:18   ` Paolo Bonzini
  2013-04-09  8:04     ` Kevin Wolf
  0 siblings, 1 reply; 11+ messages in thread
From: Paolo Bonzini @ 2013-04-08 16:18 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Kevin Wolf, qemu-devel, stefanha

Il 08/04/2013 18:03, Stefan Hajnoczi ha scritto:
> Looks fine on the block side.  Perhaps Orit, Juan, or Paolo can
> double-check the migration side.
> 
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

Looks good, but given there are patches to fix it, I'm not sure it's
worth the trouble...

Paolo

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate
  2013-04-08 16:18   ` Paolo Bonzini
@ 2013-04-09  8:04     ` Kevin Wolf
  2013-04-09  8:08       ` Paolo Bonzini
  0 siblings, 1 reply; 11+ messages in thread
From: Kevin Wolf @ 2013-04-09  8:04 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Stefan Hajnoczi, qemu-devel, stefanha

Am 08.04.2013 um 18:18 hat Paolo Bonzini geschrieben:
> Il 08/04/2013 18:03, Stefan Hajnoczi ha scritto:
> > Looks fine on the block side.  Perhaps Orit, Juan, or Paolo can
> > double-check the migration side.
> > 
> > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> 
> Looks good, but given there are patches to fix it, I'm not sure it's
> worth the trouble...

Shouldn't this perform even a little better? And we should get rid of
non-vectored interfaces in the block layer anyway.

Kevin

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate
  2013-04-09  8:04     ` Kevin Wolf
@ 2013-04-09  8:08       ` Paolo Bonzini
  2013-04-09  8:30         ` Stefan Hajnoczi
  0 siblings, 1 reply; 11+ messages in thread
From: Paolo Bonzini @ 2013-04-09  8:08 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Stefan Hajnoczi, qemu-devel, stefanha

Il 09/04/2013 10:04, Kevin Wolf ha scritto:
>> > 
>> > Looks good, but given there are patches to fix it, I'm not sure it's
>> > worth the trouble...
> Shouldn't this perform even a little better? And we should get rid of
> non-vectored interfaces in the block layer anyway.

Yes, if you have a very fast disk it should.  Network throughput with
Orit's patches jumped from 2.9 Gbps to 4.2 Gbps.  But savevm is not
live, so it is not as important to make it really fast.

Anyhow, since the patches are there to fix both the cause and the
symptom, there's really no reason to hold either series.

Paolo

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate
  2013-04-09  8:08       ` Paolo Bonzini
@ 2013-04-09  8:30         ` Stefan Hajnoczi
  0 siblings, 0 replies; 11+ messages in thread
From: Stefan Hajnoczi @ 2013-04-09  8:30 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Kevin Wolf, Stefan Hajnoczi, qemu-devel

On Tue, Apr 09, 2013 at 10:08:22AM +0200, Paolo Bonzini wrote:
> Il 09/04/2013 10:04, Kevin Wolf ha scritto:
> >> > 
> >> > Looks good, but given there are patches to fix it, I'm not sure it's
> >> > worth the trouble...
> > Shouldn't this perform even a little better? And we should get rid of
> > non-vectored interfaces in the block layer anyway.
> 
> Yes, if you have a very fast disk it should.  Network throughput with
> Orit's patches jumped from 2.9 Gbps to 4.2 Gbps.  But savevm is not
> live, so it is not as important to make it really fast.

Users have been asking about poor savevm/loadvm performance recently.  I
think anything we can do it improve it, especially since these patches
already exist, is good.

Stefan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate
  2013-04-05 19:27 [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate Kevin Wolf
                   ` (4 preceding siblings ...)
  2013-04-08 16:03 ` [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate Stefan Hajnoczi
@ 2013-04-09 12:30 ` Stefan Hajnoczi
  5 siblings, 0 replies; 11+ messages in thread
From: Stefan Hajnoczi @ 2013-04-09 12:30 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: pbonzini, qemu-devel

On Fri, Apr 05, 2013 at 09:27:52PM +0200, Kevin Wolf wrote:
> This gives us back reasonable savevm performance, which regressed in
> commit 500f0061.
> 
> Kevin Wolf (4):
>   block: Introduce bdrv_writev_vmstate
>   savevm: Implement block_writev_buffer()
>   block: Introduce bdrv_pwritev() for qcow2_save_vmstate
>   qemu-iotests: A few more bdrv_pread/pwrite tests
> 
>  block.c                       | 105 +++++++++++++++++++++++++++++++-----------
>  block/qcow2.c                 |   6 +--
>  block/sheepdog.c              |  13 ++++--
>  include/block/block.h         |   3 ++
>  include/block/block_int.h     |   4 +-
>  include/migration/qemu-file.h |   2 +-
>  savevm.c                      |  25 ++++++++--
>  tests/qemu-iotests/002        |  13 ++++++
>  tests/qemu-iotests/002.out    |  26 +++++++++++
>  9 files changed, 157 insertions(+), 40 deletions(-)
> 
> -- 
> 1.8.1.4
> 

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-04-09 12:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-05 19:27 [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate Kevin Wolf
2013-04-05 19:27 ` [Qemu-devel] [PATCH 1/4] block: Introduce bdrv_writev_vmstate Kevin Wolf
2013-04-05 19:27 ` [Qemu-devel] [PATCH 2/4] savevm: Implement block_writev_buffer() Kevin Wolf
2013-04-05 19:27 ` [Qemu-devel] [PATCH 3/4] block: Introduce bdrv_pwritev() for qcow2_save_vmstate Kevin Wolf
2013-04-05 19:27 ` [Qemu-devel] [PATCH 4/4] qemu-iotests: A few more bdrv_pread/pwrite tests Kevin Wolf
2013-04-08 16:03 ` [Qemu-devel] [PATCH 0/4] block: Vectored bdrv_writev_vmstate Stefan Hajnoczi
2013-04-08 16:18   ` Paolo Bonzini
2013-04-09  8:04     ` Kevin Wolf
2013-04-09  8:08       ` Paolo Bonzini
2013-04-09  8:30         ` Stefan Hajnoczi
2013-04-09 12:30 ` Stefan Hajnoczi

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).