1. 17 8月, 2020 2 次提交
    • M
      blk-mq: order adding requests to hctx->dispatch and checking SCHED_RESTART · d7d8535f
      Ming Lei 提交于
      SCHED_RESTART code path is relied to re-run queue for dispatch requests
      in hctx->dispatch. Meantime the SCHED_RSTART flag is checked when adding
      requests to hctx->dispatch.
      
      memory barriers have to be used for ordering the following two pair of OPs:
      
      1) adding requests to hctx->dispatch and checking SCHED_RESTART in
      blk_mq_dispatch_rq_list()
      
      2) clearing SCHED_RESTART and checking if there is request in hctx->dispatch
      in blk_mq_sched_restart().
      
      Without the added memory barrier, either:
      
      1) blk_mq_sched_restart() may miss requests added to hctx->dispatch meantime
      blk_mq_dispatch_rq_list() observes SCHED_RESTART, and not run queue in
      dispatch side
      
      or
      
      2) blk_mq_dispatch_rq_list still sees SCHED_RESTART, and not run queue
      in dispatch side, meantime checking if there is request in
      hctx->dispatch from blk_mq_sched_restart() is missed.
      
      IO hang in ltp/fs_fill test is reported by kernel test robot:
      
      	https://lkml.org/lkml/2020/7/26/77
      
      Turns out it is caused by the above out-of-order OPs. And the IO hang
      can't be observed any more after applying this patch.
      
      Fixes: bd166ef1 ("blk-mq-sched: add framework for MQ capable IO schedulers")
      Reported-by: Nkernel test robot <rong.a.chen@intel.com>
      Signed-off-by: NMing Lei <ming.lei@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Cc: Bart Van Assche <bvanassche@acm.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: David Jeffery <djeffery@redhat.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      d7d8535f
    • R
      block: blk-mq.c: fix @at_head kernel-doc warning · 26bfeb26
      Randy Dunlap 提交于
      Fix a kernel-doc warning in block/blk-mq.c:
      
      ../block/blk-mq.c:1844: warning: Function parameter or member 'at_head' not described in 'blk_mq_request_bypass_insert'
      
      Fixes: 01e99aec ("blk-mq: insert passthrough request into hctx->dispatch directly")
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Cc: André Almeida <andrealmeid@collabora.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Ming Lei <ming.lei@redhat.com>
      Cc: linux-block@vger.kernel.org
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      26bfeb26
  2. 01 8月, 2020 1 次提交
  3. 28 7月, 2020 1 次提交
  4. 10 7月, 2020 1 次提交
  5. 09 7月, 2020 2 次提交
  6. 07 7月, 2020 1 次提交
    • M
      blk-mq: consider non-idle request as "inflight" in blk_mq_rq_inflight() · 05a4fed6
      Ming Lei 提交于
      dm-multipath is the only user of blk_mq_queue_inflight().  When
      dm-multipath calls blk_mq_queue_inflight() to check if it has
      outstanding IO it can get a false negative.  The reason for this is
      blk_mq_rq_inflight() doesn't consider requests that are no longer
      MQ_RQ_IN_FLIGHT but that are now MQ_RQ_COMPLETE (->complete isn't
      called or finished yet) as "inflight".
      
      This causes request-based dm-multipath's dm_wait_for_completion() to
      return before all outstanding dm-multipath requests have actually
      completed.  This breaks DM multipath's suspend functionality because
      blk-mq requests complete after DM's suspend has finished -- which
      shouldn't happen.
      
      Fix this by considering any request not in the MQ_RQ_IDLE state
      (so either MQ_RQ_COMPLETE or MQ_RQ_IN_FLIGHT) as "inflight" in
      blk_mq_rq_inflight().
      
      Fixes: 3c94d83c ("blk-mq: change blk_mq_queue_busy() to blk_mq_queue_inflight()")
      Signed-off-by: NMing Lei <ming.lei@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      05a4fed6
  7. 02 7月, 2020 1 次提交
  8. 01 7月, 2020 5 次提交
  9. 30 6月, 2020 6 次提交
  10. 29 6月, 2020 2 次提交
  11. 24 6月, 2020 10 次提交
  12. 18 6月, 2020 1 次提交
    • W
      block: update hctx map when use multiple maps · fe35ec58
      Weiping Zhang 提交于
      There is an issue when tune the number for read and write queues,
      if the total queue count was not changed. The hctx->type cannot
      be updated, since __blk_mq_update_nr_hw_queues will return directly
      if the total queue count has not been changed.
      
      Reproduce:
      
      dmesg | grep "default/read/poll"
      [    2.607459] nvme nvme0: 48/0/0 default/read/poll queues
      cat /sys/kernel/debug/block/nvme0n1/hctx*/type | sort | uniq -c
           48 default
      
      tune the write queues to 24:
      echo 24 > /sys/module/nvme/parameters/write_queues
      echo 1 > /sys/block/nvme0n1/device/reset_controller
      
      dmesg | grep "default/read/poll"
      [  433.547235] nvme nvme0: 24/24/0 default/read/poll queues
      
      cat /sys/kernel/debug/block/nvme0n1/hctx*/type | sort | uniq -c
           48 default
      
      The driver's hardware queue mapping is not same as block layer.
      Signed-off-by: NWeiping Zhang <zhangweiping@didiglobal.com>
      Reviewed-by: NMing Lei <ming.lei@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      fe35ec58
  13. 07 6月, 2020 1 次提交
  14. 30 5月, 2020 6 次提交