1. 03 1月, 2015 1 次提交
  2. 09 12月, 2014 4 次提交
  3. 11 11月, 2014 1 次提交
  4. 30 10月, 2014 1 次提交
    • J
      blk-mq: add a 'list' parameter to ->queue_rq() · 74c45052
      Jens Axboe 提交于
      Since we have the notion of a 'last' request in a chain, we can use
      this to have the hardware optimize the issuing of requests. Add
      a list_head parameter to queue_rq that the driver can use to
      temporarily store hw commands for issue when 'last' is true. If we
      are doing a chain of requests, pass in a NULL list for the first
      request to force issue of that immediately, then batch the remainder
      for deferred issue until the last request has been sent.
      
      Instead of adding yet another argument to the hot ->queue_rq path,
      encapsulate the passed arguments in a blk_mq_queue_data structure.
      This is passed as a constant, and has been tested as faster than
      passing 4 (or even 3) args through ->queue_rq. Update drivers for
      the new ->queue_rq() prototype. There are no functional changes
      in this patch for drivers - if they don't use the passed in list,
      then they will just queue requests individually like before.
      Signed-off-by: NJens Axboe <axboe@fb.com>
      74c45052
  5. 15 10月, 2014 4 次提交
  6. 23 9月, 2014 3 次提交
  7. 02 7月, 2014 1 次提交
  8. 30 5月, 2014 1 次提交
    • M
      block: virtio_blk: don't hold spin lock during world switch · e8edca6f
      Ming Lei 提交于
      Firstly, it isn't necessary to hold lock of vblk->vq_lock
      when notifying hypervisor about queued I/O.
      
      Secondly, virtqueue_notify() will cause world switch and
      it may take long time on some hypervisors(such as, qemu-arm),
      so it isn't good to hold the lock and block other vCPUs.
      
      On arm64 quad core VM(qemu-kvm), the patch can increase I/O
      performance a lot with VIRTIO_RING_F_EVENT_IDX enabled:
      	- without the patch: 14K IOPS
      	- with the patch: 34K IOPS
      
      fio script:
      	[global]
      	direct=1
      	bsrange=4k-4k
      	timeout=10
      	numjobs=4
      	ioengine=libaio
      	iodepth=64
      
      	filename=/dev/vdc
      	group_reporting=1
      
      	[f1]
      	rw=randread
      
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: virtualization@lists.linux-foundation.org
      Signed-off-by: NMing Lei <ming.lei@canonical.com>
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: stable@kernel.org # 3.13+
      Signed-off-by: NJens Axboe <axboe@fb.com>
      e8edca6f
  9. 29 5月, 2014 1 次提交
  10. 27 5月, 2014 1 次提交
    • M
      virtio_blk: fix race between start and stop queue · aa0818c6
      Ming Lei 提交于
      When there isn't enough vring descriptor for adding to vq,
      blk-mq will be put as stopped state until some of pending
      descriptors are completed & freed.
      
      Unfortunately, the vq's interrupt may come just before
      blk-mq's BLK_MQ_S_STOPPED flag is set, so the blk-mq will
      still be kept as stopped even though lots of descriptors
      are completed and freed in the interrupt handler. The worst
      case is that all pending descriptors are freed in the
      interrupt handler, and the queue is kept as stopped forever.
      
      This patch fixes the problem by starting/stopping blk-mq
      with holding vq_lock.
      
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Cc: stable@kernel.org
      Signed-off-by: NJens Axboe <axboe@fb.com>
      
      Conflicts:
      	drivers/block/virtio_blk.c
      aa0818c6
  11. 16 5月, 2014 1 次提交
    • M
      virtio_blk: fix race between start and stop queue · 0c29e93e
      Ming Lei 提交于
      When there isn't enough vring descriptor for adding to vq,
      blk-mq will be put as stopped state until some of pending
      descriptors are completed & freed.
      
      Unfortunately, the vq's interrupt may come just before
      blk-mq's BLK_MQ_S_STOPPED flag is set, so the blk-mq will
      still be kept as stopped even though lots of descriptors
      are completed and freed in the interrupt handler. The worst
      case is that all pending descriptors are freed in the
      interrupt handler, and the queue is kept as stopped forever.
      
      This patch fixes the problem by starting/stopping blk-mq
      with holding vq_lock.
      
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      0c29e93e
  12. 17 4月, 2014 1 次提交
  13. 16 4月, 2014 3 次提交
    • C
      blk-mq: split out tag initialization, support shared tags · 24d2f903
      Christoph Hellwig 提交于
      Add a new blk_mq_tag_set structure that gets set up before we initialize
      the queue.  A single blk_mq_tag_set structure can be shared by multiple
      queues.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      
      Modular export of blk_mq_{alloc,free}_tagset added by me.
      Signed-off-by: NJens Axboe <axboe@fb.com>
      24d2f903
    • C
      blk-mq: add ->init_request and ->exit_request methods · e9b267d9
      Christoph Hellwig 提交于
      The current blk_mq_init_commands/blk_mq_free_commands interface has a
      two problems:
      
       1) Because only the constructor is passed to blk_mq_init_commands there
          is no easy way to clean up when a comman initialization failed.  The
          current code simply leaks the allocations done in the constructor.
      
       2) There is no good place to call blk_mq_free_commands: before
          blk_cleanup_queue there is no guarantee that all outstanding
          commands have completed, so we can't free them yet.  After
          blk_cleanup_queue the queue has usually been freed.  This can be
          worked around by grabbing an unconditional reference before calling
          blk_cleanup_queue and dropping it after blk_mq_free_commands is
          done, although that's not exatly pretty and driver writers are
          guaranteed to get it wrong sooner or later.
      
      Both issues are easily fixed by making the request constructor and
      destructor normal blk_mq_ops methods.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      e9b267d9
    • C
      blk-mq: do not initialize req->special · 9d74e257
      Christoph Hellwig 提交于
      Drivers can reach their private data easily using the blk_mq_rq_to_pdu
      helper and don't need req->special.  By not initializing it code can
      be simplified nicely, and we also shave off a few more instructions from
      the I/O path.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      9d74e257
  14. 24 3月, 2014 1 次提交
    • R
      virtio-blk: base queue-depth on virtqueue ringsize or module param · fc4324b4
      Rusty Russell 提交于
      Venkatash spake thus:
      
        virtio-blk set the default queue depth to 64 requests, which was
        insufficient for high-IOPS devices. Instead set the blk-queue depth to
        the device's virtqueue depth divided by two (each I/O requires at least
        two VQ entries).
      
      But behold, Ted added a module parameter:
      
        Also allow the queue depth to be something which can be set at module
        load time or via a kernel boot-time parameter, for
        testing/benchmarking purposes.
      
      And I rewrote it substantially, mainly to take
      VIRTIO_RING_F_INDIRECT_DESC into account.
      
      As QEMU sets the vq size for PCI to 128, Venkatash's patch wouldn't
      have made a change.  This version does (since QEMU also offers
      VIRTIO_RING_F_INDIRECT_DESC.
      Inspired-by: N"Theodore Ts'o" <tytso@mit.edu>
      Based-on-the-true-story-of: Venkatesh Srinivas <venkateshs@google.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: virtio-dev@lists.oasis-open.org
      Cc: virtualization@lists.linux-foundation.org
      Cc: Frank Swiderski <fes@google.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      fc4324b4
  15. 15 3月, 2014 1 次提交
    • J
      blk-mq: allow blk_mq_init_commands() to return failure · 95363efd
      Jens Axboe 提交于
      If drivers do dynamic allocation in the hardware command init
      path, then we need to be able to handle and return failures.
      
      And if they do allocations or mappings in the init command path,
      then we need a cleanup function to free up that space at exit
      time. So add blk_mq_free_commands() as the cleanup function.
      
      This is required for the mtip32xx driver conversion to blk-mq.
      Signed-off-by: NJens Axboe <axboe@fb.com>
      95363efd
  16. 13 3月, 2014 1 次提交
  17. 11 2月, 2014 1 次提交
  18. 20 11月, 2013 1 次提交
  19. 14 11月, 2013 1 次提交
  20. 29 10月, 2013 1 次提交
  21. 17 10月, 2013 1 次提交
  22. 23 9月, 2013 1 次提交
  23. 20 5月, 2013 1 次提交
  24. 20 3月, 2013 4 次提交
  25. 12 3月, 2013 1 次提交
    • M
      virtio-blk: emit udev event when device is resized · 9d9598b8
      Milos Vyletel 提交于
      When virtio-blk device is resized from host (using block_resize from QEMU) emit
      KOBJ_CHANGE uevent to notify guest about such change. This allows user to have
      custom udev rules which would take whatever action if such event occurs. As a
      proof of concept I've created simple udev rule that automatically resize
      filesystem on virtio-blk device.
      
      ACTION=="change", KERNEL=="vd*", \
              ENV{RESIZE}=="1", \
              ENV{ID_FS_TYPE}=="ext[3-4]", \
              RUN+="/sbin/resize2fs /dev/%k"
      ACTION=="change", KERNEL=="vd*", \
              ENV{RESIZE}=="1", \
              ENV{ID_FS_TYPE}=="LVM2_member", \
              RUN+="/sbin/pvresize /dev/%k"
      Signed-off-by: NMilos Vyletel <milos.vyletel@sde.cz>
      Tested-by: NAsias He <asias@redhat.com>
      Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (minor simplification)
      9d9598b8
  26. 04 1月, 2013 1 次提交
    • G
      Drivers: block: remove __dev* attributes. · 8d85fce7
      Greg Kroah-Hartman 提交于
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the use of __devinit, __devexit_p, __devinitdata,
      __devinitconst, and __devexit from these drivers.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: Mike Miller <mike.miller@hp.com>
      Cc: Chirag Kantharia <chirag.kantharia@hp.com>
      Cc: Geoff Levand <geoff@infradead.org>
      Cc: Jim Paris <jim@jtan.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
      Cc: Keith Busch <keith.busch@intel.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: NeilBrown <neilb@suse.de>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Tao Guo <Tao.Guo@emc.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8d85fce7
  27. 02 1月, 2013 1 次提交
    • A
      virtio-blk: Don't free ida when disk is in use · f4953fe6
      Alexander Graf 提交于
      When a file system is mounted on a virtio-blk disk, we then remove it
      and then reattach it, the reattached disk gets the same disk name and
      ids as the hot removed one.
      
      This leads to very nasty effects - mostly rendering the newly attached
      device completely unusable.
      
      Trying what happens when I do the same thing with a USB device, I saw
      that the sd node simply doesn't get free'd when a device gets forcefully
      removed.
      
      Imitate the same behavior for vd devices. This way broken vd devices
      simply are never free'd and newly attached ones keep working just fine.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: stable@kernel.org
      f4953fe6