1. 20 1月, 2016 3 次提交
  2. 22 12月, 2015 2 次提交
  3. 18 12月, 2015 1 次提交
  4. 03 12月, 2015 1 次提交
  5. 12 11月, 2015 5 次提交
  6. 30 10月, 2015 1 次提交
  7. 24 10月, 2015 3 次提交
  8. 16 10月, 2015 3 次提交
  9. 12 10月, 2015 1 次提交
  10. 25 9月, 2015 1 次提交
  11. 07 7月, 2015 1 次提交
    • S
      block: update bdrv_drain_all()/bdrv_drain() comments · 7a63f3cd
      Stefan Hajnoczi 提交于
      The doc comments for bdrv_drain_all() and bdrv_drain() are outdated:
      
       * The bdrv_drain() comment is a poor man's bdrv_lock()/bdrv_unlock()
         which Fam Zheng is currently developing.  Unfortunately this warning
         was never really enough because devices keep submitting I/O and op
         blockers don't prevent that.
      
       * The bdrv_drain_all() comment is still partially correct but reflects
         the nature of the implementation rather than API documentation.
      
      Do make it clear that bdrv_drain() is only appropriate within an
      AioContext.  For anything spanning AioContexts you need
      bdrv_drain_all().
      
      Cc: Markus Armbruster <armbru@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Message-id: 1435854281-6078-1-git-send-email-stefanha@redhat.com
      7a63f3cd
  12. 02 7月, 2015 3 次提交
  13. 23 6月, 2015 3 次提交
  14. 12 6月, 2015 2 次提交
  15. 22 5月, 2015 6 次提交
    • P
      block: get_block_status: use "else" when testing the opposite condition · a53f1a95
      Paolo Bonzini 提交于
      A bit of Boolean algebra (and common sense) tells us that the
      second "if" here is looking for blocks that are not allocated.
      This is the opposite of the "if" that sets BDRV_BLOCK_ALLOCATED,
      and thus it can use an "else".
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Message-id: 1431599702-10431-1-git-send-email-pbonzini@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      a53f1a95
    • F
      block: Fix NULL deference for unaligned write if qiov is NULL · 9eeb6dd1
      Fam Zheng 提交于
      For zero write, callers pass in NULL qiov (qemu-io "write -z" or
      scsi-disk "write same").
      
      Commit fc3959e4 fixed bdrv_co_write_zeroes which is the common case
      for this bug, but it still exists in bdrv_aio_write_zeroes. A simpler
      fix would be in bdrv_co_do_pwritev which is the NULL dereference point
      and covers both cases.
      
      So don't access it in bdrv_co_do_pwritev in this case, use three aligned
      writes.
      
      [Initialize ret to 0 in bdrv_co_do_zero_pwritev() to avoid uninitialized
      variable warning with gcc 4.9.2.
      --Stefan]
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-id: 1431522721-3266-3-git-send-email-famz@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      9eeb6dd1
    • F
      Revert "block: Fix unaligned zero write" · d01c07f2
      Fam Zheng 提交于
      This reverts commit fc3959e4.
      
      The core write code already handles the case, so remove this
      duplication.
      
      Because commit 61007b31 moved the touched code from block.c to
      block/io.c, the change is manually reverted.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Message-id: 1431522721-3266-2-git-send-email-famz@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      d01c07f2
    • D
      block: align bounce buffers to page · 459b4e66
      Denis V. Lunev 提交于
      The following sequence
          int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644);
          for (i = 0; i < 100000; i++)
                  write(fd, buf, 4096);
      performs 5% better if buf is aligned to 4096 bytes.
      
      The difference is quite reliable.
      
      On the other hand we do not want at the moment to enforce bounce
      buffering if guest request is aligned to 512 bytes.
      
      The patch changes default bounce buffer optimal alignment to
      MAX(page size, 4k). 4k is chosen as maximal known sector size on real
      HDD.
      
      The justification of the performance improve is quite interesting.
      From the kernel point of view each request to the disk was split
      by two. This could be seen by blktrace like this:
        9,0   11  1     0.000000000 11151  Q  WS 312737792 + 1023 [qemu-img]
        9,0   11  2     0.000007938 11151  Q  WS 312738815 + 8 [qemu-img]
        9,0   11  3     0.000030735 11151  Q  WS 312738823 + 1016 [qemu-img]
        9,0   11  4     0.000032482 11151  Q  WS 312739839 + 8 [qemu-img]
        9,0   11  5     0.000041379 11151  Q  WS 312739847 + 1016 [qemu-img]
        9,0   11  6     0.000042818 11151  Q  WS 312740863 + 8 [qemu-img]
        9,0   11  7     0.000051236 11151  Q  WS 312740871 + 1017 [qemu-img]
        9,0    5  1     0.169071519 11151  Q  WS 312741888 + 1023 [qemu-img]
      After the patch the pattern becomes normal:
        9,0    6  1     0.000000000 12422  Q  WS 314834944 + 1024 [qemu-img]
        9,0    6  2     0.000038527 12422  Q  WS 314835968 + 1024 [qemu-img]
        9,0    6  3     0.000072849 12422  Q  WS 314836992 + 1024 [qemu-img]
        9,0    6  4     0.000106276 12422  Q  WS 314838016 + 1024 [qemu-img]
      and the amount of requests sent to disk (could be calculated counting
      number of lines in the output of blktrace) is reduced about 2 times.
      
      Both qemu-img and qemu-io are affected while qemu-kvm is not. The guest
      does his job well and real requests comes properly aligned (to page).
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Message-id: 1431441056-26198-3-git-send-email-den@openvz.org
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      459b4e66
    • D
      block: minimal bounce buffer alignment · 4196d2f0
      Denis V. Lunev 提交于
      The patch introduces new concept: minimal memory alignment for bounce
      buffers. Original so called "optimal" value is actually minimal required
      value for aligment. It should be used for validation that the IOVec
      is properly aligned and bounce buffer is not required.
      
      Though, from the performance point of view, it would be better if
      bounce buffer or IOVec allocated by QEMU will be aligned stricter.
      
      The patch does not change any alignment value yet.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Message-id: 1431441056-26198-2-git-send-email-den@openvz.org
      CC: Paolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      4196d2f0
    • P
      block: return EPERM on writes or discards to read-only devices · eaf5fe2d
      Paolo Bonzini 提交于
      This is the behavior in the operating system, for example Linux's
      blkdev_write_iter has the following:
      
              if (bdev_read_only(I_BDEV(bd_inode)))
                      return -EPERM;
      
      This does not apply to opening a device for read/write, when the
      device only supports read-only operation.  In this case any of
      EACCES, EPERM or EROFS is acceptable depending on why writing is
      not possible.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1431013548-22492-1-git-send-email-pbonzini@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      eaf5fe2d
  16. 28 4月, 2015 1 次提交
    • S
      block: move I/O request processing to block/io.c · 61007b31
      Stefan Hajnoczi 提交于
      The block.c file has grown to over 6000 lines.  It is time to split this
      file so there are fewer conflicts and the code is easier to maintain.
      
      Extract I/O request processing code:
       * Read
       * Write
       * Zero writes and making the image empty
       * Flush
       * Discard
       * ioctl
       * Tracked requests and queuing
       * Throttling and copy-on-read
       * Block status and allocated functions
       * Refreshing block limits
       * Reading/writing vmstate
       * qemu_blockalign() and friends
      
      The patch simply moves code from block.c into block/io.c.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      61007b31