Skip to content
  • Matias Bjørling's avatar
    NVMe: Convert to blk-mq · a4aea562
    Matias Bjørling authored
    
    
    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: default avatarKeith Busch <keith.busch@intel.com>
    Acked-by: default avatarJens Axboe <axboe@fb.com>
    
    Updated for new ->queue_rq() prototype.
    
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    a4aea562