1. 17 4月, 2020 1 次提交
  2. 19 3月, 2020 1 次提交
  3. 08 3月, 2020 2 次提交
  4. 06 2月, 2020 1 次提交
  5. 03 1月, 2020 1 次提交
  6. 21 5月, 2019 1 次提交
  7. 10 4月, 2019 1 次提交
    • D
      virtio-blk: limit number of hw queues by nr_cpu_ids · bf348f9b
      Dongli Zhang 提交于
      When tag_set->nr_maps is 1, the block layer limits the number of hw queues
      by nr_cpu_ids. No matter how many hw queues are used by virtio-blk, as it
      has (tag_set->nr_maps == 1), it can use at most nr_cpu_ids hw queues.
      
      In addition, specifically for pci scenario, when the 'num-queues' specified
      by qemu is more than maxcpus, virtio-blk would not be able to allocate more
      than maxcpus vectors in order to have a vector for each queue. As a result,
      it falls back into MSI-X with one vector for config and one shared for
      queues.
      
      Considering above reasons, this patch limits the number of hw queues used
      by virtio-blk by nr_cpu_ids.
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NDongli Zhang <dongli.zhang@oracle.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      bf348f9b
  8. 08 4月, 2019 1 次提交
  9. 07 3月, 2019 1 次提交
  10. 20 12月, 2018 1 次提交
  11. 30 11月, 2018 1 次提交
  12. 08 11月, 2018 1 次提交
  13. 28 9月, 2018 2 次提交
  14. 25 5月, 2018 1 次提交
  15. 14 5月, 2018 1 次提交
  16. 01 2月, 2018 1 次提交
    • S
      virtio_blk: print capacity at probe time · daf2a501
      Stefan Hajnoczi 提交于
      Print the capacity of the block device when the driver is probed.  Many
      users expect this since SCSI disks (sd) do it.  Moreover, kernel dmesg
      output is the primary source of troubleshooting information so it's
      helpful to include the disk size there.
      
      The capacity is already printed by virtio_blk when a resize event
      occurs.  Extract the code and reuse it from virtblk_probe().
      
      This patch also adds the block device name to the message so it can be
      correlated with a specific device:
      
        virtio_blk virtio0: [vda] 20971520 512-byte logical blocks (10.7 GB/10.0 GiB)
      
      Cc: Rodrigo A B Freire <rfreire@redhat.com>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      daf2a501
  17. 31 1月, 2018 1 次提交
    • M
      blk-mq: introduce BLK_STS_DEV_RESOURCE · 86ff7c2a
      Ming Lei 提交于
      This status is returned from driver to block layer if device related
      resource is unavailable, but driver can guarantee that IO dispatch
      will be triggered in future when the resource is available.
      
      Convert some drivers to return BLK_STS_DEV_RESOURCE.  Also, if driver
      returns BLK_STS_RESOURCE and SCHED_RESTART is set, rerun queue after
      a delay (BLK_MQ_DELAY_QUEUE) to avoid IO stalls.  BLK_MQ_DELAY_QUEUE is
      3 ms because both scsi-mq and nvmefc are using that magic value.
      
      If a driver can make sure there is in-flight IO, it is safe to return
      BLK_STS_DEV_RESOURCE because:
      
      1) If all in-flight IOs complete before examining SCHED_RESTART in
      blk_mq_dispatch_rq_list(), SCHED_RESTART must be cleared, so queue
      is run immediately in this case by blk_mq_dispatch_rq_list();
      
      2) if there is any in-flight IO after/when examining SCHED_RESTART
      in blk_mq_dispatch_rq_list():
      - if SCHED_RESTART isn't set, queue is run immediately as handled in 1)
      - otherwise, this request will be dispatched after any in-flight IO is
        completed via blk_mq_sched_restart()
      
      3) if SCHED_RESTART is set concurently in context because of
      BLK_STS_RESOURCE, blk_mq_delay_run_hw_queue() will cover the above two
      cases and make sure IO hang can be avoided.
      
      One invariant is that queue will be rerun if SCHED_RESTART is set.
      Suggested-by: NJens Axboe <axboe@kernel.dk>
      Tested-by: NLaurence Oberman <loberman@redhat.com>
      Signed-off-by: NMing Lei <ming.lei@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      86ff7c2a
  18. 27 10月, 2017 1 次提交
  19. 26 8月, 2017 1 次提交
    • S
      virtio_blk: fix incorrect message when disk is resized · 1046d304
      Stefan Hajnoczi 提交于
      The message printed on disk resize is incorrect.  The following is
      printed when resizing to 2 GiB:
      
        $ truncate -s 1G test.img
        $ qemu -device virtio-blk-pci,logical_block_size=4096,...
        (qemu) block_resize drive1 2G
      
        virtio_blk virtio0: new size: 4194304 4096-byte logical blocks (17.2 GB/16.0 GiB)
      
      The virtio_blk capacity config field is in 512-byte sector units
      regardless of logical_block_size as per the VIRTIO specification.
      Therefore the message should read:
      
        virtio_blk virtio0: new size: 524288 4096-byte logical blocks (2.15 GB/2.0 GiB)
      
      Note that this only affects the printed message.  Thankfully the actual
      block device has the correct size because the block layer expects
      capacity in sectors.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      1046d304
  20. 18 8月, 2017 1 次提交
  21. 25 7月, 2017 1 次提交
  22. 06 7月, 2017 1 次提交
  23. 28 6月, 2017 1 次提交
  24. 09 6月, 2017 2 次提交
    • C
      blk-mq: switch ->queue_rq return value to blk_status_t · fc17b653
      Christoph Hellwig 提交于
      Use the same values for use for request completion errors as the return
      value from ->queue_rq.  BLK_STS_RESOURCE is special cased to cause
      a requeue, and all the others are completed as-is.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      fc17b653
    • C
      block: introduce new block status code type · 2a842aca
      Christoph Hellwig 提交于
      Currently we use nornal Linux errno values in the block layer, and while
      we accept any error a few have overloaded magic meanings.  This patch
      instead introduces a new  blk_status_t value that holds block layer specific
      status codes and explicitly explains their meaning.  Helpers to convert from
      and to the previous special meanings are provided for now, but I suspect
      we want to get rid of them in the long run - those drivers that have a
      errno input (e.g. networking) usually get errnos that don't know about
      the special block layer overloads, and similarly returning them to userspace
      will usually return somethings that strictly speaking isn't correct
      for file system operations, but that's left as an exercise for later.
      
      For now the set of errors is a very limited set that closely corresponds
      to the previous overloaded errno values, but there is some low hanging
      fruite to improve it.
      
      blk_status_t (ab)uses the sparse __bitwise annotations to allow for sparse
      typechecking, so that we can easily catch places passing the wrong values.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      2a842aca
  25. 03 5月, 2017 1 次提交
  26. 02 5月, 2017 1 次提交
  27. 21 4月, 2017 5 次提交
  28. 31 3月, 2017 1 次提交
  29. 28 2月, 2017 2 次提交
  30. 01 2月, 2017 3 次提交