1. 13 9月, 2016 8 次提交
    • C
      Backup: export interfaces for extra serialization · a8bbee0e
      Changlong Xie 提交于
      Normal backup(sync='none') workflow:
      step 1. NBD peformance I/O write from client to server
         qcow2_co_writev
          bdrv_co_writev
           ...
             bdrv_aligned_pwritev
              notifier_with_return_list_notify -> backup_do_cow
               bdrv_driver_pwritev // write new contents
      
      step 2. drive-backup sync=none
         backup_do_cow
         {
          wait_for_overlapping_requests
          cow_request_begin
          for(; start < end; start++) {
                  bdrv_co_readv_no_serialising //read old contents from Secondary disk
                  bdrv_co_writev // write old contents to hidden-disk
          }
          cow_request_end
         }
      
      step 3. Then roll back to "step 1" to write new contents to Secondary disk.
      
      And for replication, we must make sure that we only read the old contents from
      Secondary disk in order to keep contents consistent.
      
      1) Replication workflow of Secondary
                                                               virtio-blk
                                                                    ^
      ------->  1 NBD                                               |
         ||     server                                       3 replication
         ||        ^                                                ^
         ||        |           backing                 backing      |
         ||  Secondary disk 6<-------- hidden-disk 5 <-------- active-disk 4
         ||        |                         ^
         ||        '-------------------------'
         ||           drive-backup sync=none 2
      
      Hence, we need these interfaces to implement coarse-grained serialization between
      COW of Secondary disk and the read operation of replication.
      
      Example codes about how to use them:
      
      *#include "block/block_backup.h"
      
      static coroutine_fn int xxx_co_readv()
      {
              CowRequest req;
              BlockJob *job = secondary_disk->bs->job;
      
              if (job) {
                    backup_wait_for_overlapping_requests(job, start, end);
                    backup_cow_request_begin(&req, job, start, end);
                    ret = bdrv_co_readv();
                    backup_cow_request_end(&req);
                    goto out;
              }
              ret = bdrv_co_readv();
      out:
              return ret;
      }
      Signed-off-by: NChanglong Xie <xiecl.fnst@cn.fujitsu.com>
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      Signed-off-by: NWang WeiWei <wangww.fnst@cn.fujitsu.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 1469602913-20979-4-git-send-email-xiecl.fnst@cn.fujitsu.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      a8bbee0e
    • W
      Backup: clear all bitmap when doing block checkpoint · 49d3e828
      Wen Congyang 提交于
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      Signed-off-by: NChanglong Xie <xiecl.fnst@cn.fujitsu.com>
      Signed-off-by: NWang WeiWei <wangww.fnst@cn.fujitsu.com>
      Signed-off-by: Nzhanghailiang <zhang.zhanghailiang@huawei.com>
      Signed-off-by: NGonglei <arei.gonglei@huawei.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 1469602913-20979-3-git-send-email-xiecl.fnst@cn.fujitsu.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      49d3e828
    • W
      block: unblock backup operations in backing file · e9d6456e
      Wen Congyang 提交于
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      Signed-off-by: NChanglong Xie <xiecl.fnst@cn.fujitsu.com>
      Signed-off-by: NWang WeiWei <wangww.fnst@cn.fujitsu.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Kashyap Chamarthy <kchamart@redhat.com>
      Message-id: 1469602913-20979-2-git-send-email-xiecl.fnst@cn.fujitsu.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      e9d6456e
    • C
      virtio-blk: rename virtio_device_info to virtio_blk_info · b5c7ceaf
      Changlong Xie 提交于
      The old one is confusing with @virtio_device_info in virtio.c,
      so make it more appropriate.
      Signed-off-by: NChanglong Xie <xiecl.fnst@cn.fujitsu.com>
      Message-id: 1470214147-32560-1-git-send-email-xiecl.fnst@cn.fujitsu.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      b5c7ceaf
    • R
      linux-aio: process completions from ioq_submit() · 0ed93d84
      Roman Pen 提交于
      In order to reduce completion latency it makes sense to harvest completed
      requests ASAP.  Very fast backend device can complete requests just after
      submission, so it is worth trying to check ring buffer in order to peek
      completed requests directly after io_submit() has been called.
      
      Indeed, this patch reduces the completions latencies and increases the
      overall throughput, e.g. the following is the percentiles of number of
      completed requests at once:
      
              1th 10th  20th  30th  40th  50th  60th  70th  80th  90th  99.99th
      Before    2    4    42   112   128   128   128   128   128   128    128
       After    1    1     4    14    33    45    47    48    50    51    108
      
      That means, that before the current patch is applied the ring buffer is
      observed as full (128 requests were consumed at once) in 60% of calls.
      
      After patch is applied the distribution of number of completed requests
      is "smoother" and the queue (requests in-flight) is almost never full.
      
      The fio read results are the following (write results are almost the
      same and are not showed here):
      
        Before
        ------
      job: (groupid=0, jobs=8): err= 0: pid=2227: Tue Jul 19 11:29:50 2016
        Description  : [Emulation of Storage Server Access Pattern]
        read : io=54681MB, bw=1822.7MB/s, iops=179779, runt= 30001msec
          slat (usec): min=172, max=16883, avg=338.35, stdev=109.66
          clat (usec): min=1, max=21977, avg=1051.45, stdev=299.29
           lat (usec): min=317, max=22521, avg=1389.83, stdev=300.73
          clat percentiles (usec):
           |  1.00th=[  346],  5.00th=[  596], 10.00th=[  708], 20.00th=[  852],
           | 30.00th=[  932], 40.00th=[  996], 50.00th=[ 1048], 60.00th=[ 1112],
           | 70.00th=[ 1176], 80.00th=[ 1256], 90.00th=[ 1384], 95.00th=[ 1496],
           | 99.00th=[ 1800], 99.50th=[ 1928], 99.90th=[ 2320], 99.95th=[ 2672],
           | 99.99th=[ 4704]
          bw (KB  /s): min=205229, max=553181, per=12.50%, avg=233278.26, stdev=18383.51
      
        After
        ------
      job: (groupid=0, jobs=8): err= 0: pid=2220: Tue Jul 19 11:31:51 2016
        Description  : [Emulation of Storage Server Access Pattern]
        read : io=57637MB, bw=1921.2MB/s, iops=189529, runt= 30002msec
          slat (usec): min=169, max=20636, avg=329.61, stdev=124.18
          clat (usec): min=2, max=19592, avg=988.78, stdev=251.04
           lat (usec): min=381, max=21067, avg=1318.42, stdev=243.58
          clat percentiles (usec):
           |  1.00th=[  310],  5.00th=[  580], 10.00th=[  748], 20.00th=[  876],
           | 30.00th=[  908], 40.00th=[  948], 50.00th=[ 1012], 60.00th=[ 1064],
           | 70.00th=[ 1080], 80.00th=[ 1128], 90.00th=[ 1224], 95.00th=[ 1288],
           | 99.00th=[ 1496], 99.50th=[ 1608], 99.90th=[ 1960], 99.95th=[ 2256],
           | 99.99th=[ 5408]
          bw (KB  /s): min=212149, max=390160, per=12.49%, avg=245746.04, stdev=11606.75
      
      Throughput increased from 1822MB/s to 1921MB/s, average completion latencies
      decreased from 1051us to 988us.
      Signed-off-by: NRoman Pen <roman.penyaev@profitbricks.com>
      Message-id: 1468931263-32667-4-git-send-email-roman.penyaev@profitbricks.com
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: qemu-devel@nongnu.org
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      0ed93d84
    • R
      linux-aio: split processing events function · 3407de57
      Roman Pen 提交于
      Prepare processing events function to be called from ioq_submit(),
      thus split function on two parts: the first harvests completed IO
      requests, the second submits pending requests.
      Signed-off-by: NRoman Pen <roman.penyaev@profitbricks.com>
      Message-id: 1468931263-32667-3-git-send-email-roman.penyaev@profitbricks.com
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: qemu-devel@nongnu.org
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      3407de57
    • R
      linux-aio: consume events in userspace instead of calling io_getevents · 9e909a58
      Roman Pen 提交于
      AIO context in userspace is represented as a simple ring buffer, which
      can be consumed directly without entering the kernel, which obviously
      can bring some performance gain.  QEMU does not use timeout value for
      waiting for events completions, so we can consume all events from
      userspace.
      Signed-off-by: NRoman Pen <roman.penyaev@profitbricks.com>
      Message-id: 1468931263-32667-2-git-send-email-roman.penyaev@profitbricks.com
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: qemu-devel@nongnu.org
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      9e909a58
    • S
      qcow2: avoid memcpy(dst, NULL, len) · 0647d47c
      Stefan Hajnoczi 提交于
      Section "7.1.4 Use of library functions" in the C99 standard says:
      
        If an argument to a function has an invalid value (such as [...]
        a null pointer [...]) [...] the behavior is undefined.
      
      Additionally the "searching and sorting" functions are specified as
      requiring valid pointer values as described in 7.1.4.
      
      This patch fixes the following sanitizer errors:
      
        block/qcow2.c:1807:41: runtime error: null pointer passed as argument 2, which is declared to never be null
        block/qcow2-cluster.c:86:26: runtime error: null pointer passed as argument 2, which is declared to never be null
      Reported-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Message-id: 1473758138-19260-1-git-send-email-stefanha@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      0647d47c
  2. 12 9月, 2016 7 次提交
  3. 10 9月, 2016 14 次提交
  4. 09 9月, 2016 2 次提交
    • P
      Merge remote-tracking branch 'remotes/famz/tags/docker-pull-request' into staging · c2a57aae
      Peter Maydell 提交于
      # gpg: Signature made Fri 09 Sep 2016 05:54:35 BST
      # gpg:                using RSA key 0xCA35624C6A9171C6
      # gpg: Good signature from "Fam Zheng <famz@redhat.com>"
      # gpg: WARNING: This key is not certified with a trusted signature!
      # gpg:          There is no indication that the signature belongs to the owner.
      # Primary key fingerprint: 5003 7CB7 9706 0F76 F021  AD56 CA35 624C 6A91 71C6
      
      * remotes/famz/tags/docker-pull-request:
        docker: silence debootstrap when --quiet is given
        docker: build debootstrap after cloning
        docker: make sure debootstrap is at least 1.0.67
        docker: print warning if EXECUTABLE is not set when building debootstrap image
        docker: debian-bootstrap.pre: print helpful message if DEB_ARCH/DEB_TYPE unset
        docker: debian-bootstrap.pre: print error messages to stderr
        docker: avoid dependency on 'realpath' package
        docker.py: don't hang on large docker output
        docker: Add a glib2-2.22 image
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      c2a57aae
    • P
      qtest.c: Allow zero size in memset qtest commands · 5f31bbf1
      Peter Maydell 提交于
      Some tests use the qtest protocol "memset" command with a zero
      size, expecting it to do nothing. However in the current code this
      will result in calling memset() with a NULL pointer, which is
      undefined behaviour. Detect and specially handle zero sizes to
      avoid this.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 1470393800-7882-1-git-send-email-peter.maydell@linaro.org
      5f31bbf1
  5. 08 9月, 2016 9 次提交