1. 05 11月, 2014 3 次提交
    • M
      NVMe: Convert to blk-mq · a4aea562
      Matias Bjørling 提交于
      This converts the NVMe driver to a blk-mq request-based driver.
      
      The NVMe driver is currently bio-based and implements queue logic within
      itself.  By using blk-mq, a lot of these responsibilities can be moved
      and simplified.
      
      The patch is divided into the following blocks:
      
       * Per-command data and cmdid have been moved into the struct request
         field. The cmdid_data can be retrieved using blk_mq_rq_to_pdu() and id
         maintenance are now handled by blk-mq through the rq->tag field.
      
       * The logic for splitting bio's has been moved into the blk-mq layer.
         The driver instead notifies the block layer about limited gap support in
         SG lists.
      
       * blk-mq handles timeouts and is reimplemented within nvme_timeout().
         This both includes abort handling and command cancelation.
      
       * Assignment of nvme queues to CPUs are replaced with the blk-mq
         version. The current blk-mq strategy is to assign the number of
         mapped queues and CPUs to provide synergy, while the nvme driver
         assign as many nvme hw queues as possible. This can be implemented in
         blk-mq if needed.
      
       * NVMe queues are merged with the tags structure of blk-mq.
      
       * blk-mq takes care of setup/teardown of nvme queues and guards invalid
         accesses. Therefore, RCU-usage for nvme queues can be removed.
      
       * IO tracing and accounting are handled by blk-mq and therefore removed.
      
       * Queue suspension logic is replaced with the logic from the block
         layer.
      
      Contributions in this patch from:
      
        Sam Bradshaw <sbradshaw@micron.com>
        Jens Axboe <axboe@fb.com>
        Keith Busch <keith.busch@intel.com>
        Robert Nelson <rlnelson@google.com>
      Acked-by: NKeith Busch <keith.busch@intel.com>
      Acked-by: NJens Axboe <axboe@fb.com>
      
      Updated for new ->queue_rq() prototype.
      Signed-off-by: NJens Axboe <axboe@fb.com>
      a4aea562
    • K
      NVMe: Mismatched host/device page size support · 1d090624
      Keith Busch 提交于
      Adds support for devices with max page size smaller than the host's.
      In the case we encounter such a host/device combination, the driver will
      split a page into as many PRP entries as necessary for the device's page
      size capabilities. If the device's reported minimum page size is greater
      than the host's, the driver will not attempt to enable the device and
      return an error instead.
      Signed-off-by: NKeith Busch <keith.busch@intel.com>
      Signed-off-by: NMatthew Wilcox <matthew.r.wilcox@intel.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      1d090624
    • K
      NVMe: Async event request · 6fccf938
      Keith Busch 提交于
      Submits NVMe asynchronous event requests, one event up to the controller
      maximum or number of possible different event types (8), whichever is
      smaller. Events successfully returned by the controller are logged.
      Signed-off-by: NKeith Busch <keith.busch@intel.com>
      Signed-off-by: NMatthew Wilcox <matthew.r.wilcox@intel.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      6fccf938
  2. 13 6月, 2014 1 次提交
    • K
      NVMe: Fix hot cpu notification dead lock · f3db22fe
      Keith Busch 提交于
      There is a potential dead lock if a cpu event occurs during nvme probe
      since it registered with hot cpu notification. This fixes the race by
      having the module register with notification outside of probe rather
      than have each device register.
      
      The actual work is done in a scheduled work queue instead of in the
      notifier since assigning IO queues has the potential to block if the
      driver creates additional queues.
      Signed-off-by: NKeith Busch <keith.busch@intel.com>
      Signed-off-by: NMatthew Wilcox <matthew.r.wilcox@intel.com>
      f3db22fe
  3. 04 6月, 2014 1 次提交
  4. 05 5月, 2014 3 次提交
  5. 11 4月, 2014 4 次提交
  6. 24 3月, 2014 2 次提交
    • K
      NVMe: IOCTL path RCU protect queue access · 4f5099af
      Keith Busch 提交于
      This adds rcu protected access to a queue in the nvme IOCTL path
      to fix potential races between a surprise removal and queue usage in
      nvme_submit_sync_cmd. The fix holds the rcu_read_lock() here to prevent
      the nvme_queue from freeing while this path is executing so it can't
      sleep, and so this path will no longer wait for a available command
      id should they all be in use at the time a passthrough IOCTL request
      is received.
      Signed-off-by: NKeith Busch <keith.busch@intel.com>
      Signed-off-by: NMatthew Wilcox <matthew.r.wilcox@intel.com>
      4f5099af
    • K
      NVMe: RCU protected access to io queues · 5a92e700
      Keith Busch 提交于
      This adds rcu protected access to nvme_queue to fix a race between a
      surprise removal freeing the queue and a thread with open reference on
      a NVMe block device using that queue.
      
      The queues do not need to be rcu protected during the initialization or
      shutdown parts, so I've added a helper function for raw deferencing
      to get around the sparse errors.
      
      There is still a hole in the IOCTL path for the same problem, which is
      fixed in a subsequent patch.
      Signed-off-by: NKeith Busch <keith.busch@intel.com>
      Signed-off-by: NMatthew Wilcox <matthew.r.wilcox@intel.com>
      5a92e700
  7. 07 3月, 2014 1 次提交
    • T
      nvme: don't use PREPARE_WORK · 9ca97374
      Tejun Heo 提交于
      PREPARE_[DELAYED_]WORK() are being phased out.  They have few users
      and a nasty surprise in terms of reentrancy guarantee as workqueue
      considers work items to be different if they don't have the same work
      function.
      
      nvme_dev->reset_work is multiplexed with multiple work functions.
      Introduce nvme_reset_workfn() which invokes nvme_dev->reset_workfn and
      always use it as the work function and update the users to set the
      ->reset_workfn field instead of overriding the work function using
      PREPARE_WORK().
      
      It would probably be best to route this with other related updates
      through the workqueue tree.
      
      Compile tested.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Cc: linux-nvme@lists.infradead.org
      9ca97374
  8. 28 1月, 2014 2 次提交
  9. 17 12月, 2013 2 次提交
  10. 19 11月, 2013 1 次提交
  11. 04 9月, 2013 3 次提交
  12. 21 6月, 2013 1 次提交
  13. 08 5月, 2013 1 次提交
  14. 03 5月, 2013 2 次提交
  15. 17 4月, 2013 3 次提交
  16. 29 3月, 2013 1 次提交
  17. 27 3月, 2013 3 次提交
  18. 13 11月, 2012 1 次提交
  19. 28 7月, 2012 1 次提交
  20. 27 7月, 2012 1 次提交
  21. 05 11月, 2011 3 次提交