1. 05 5月, 2015 1 次提交
    • S
      blk-mq: don't lose requests if a stopped queue restarts · 9ba52e58
      Shaohua Li 提交于
      Normally if driver is busy to dispatch a request the logic is like below:
      block layer:					driver:
      	__blk_mq_run_hw_queue
      a.						blk_mq_stop_hw_queue
      b.	rq add to ctx->dispatch
      
      later:
      1.						blk_mq_start_hw_queue
      2.	__blk_mq_run_hw_queue
      
      But it's possible step 1-2 runs between a and b. And since rq isn't in
      ctx->dispatch yet, step 2 will not run rq. The rq might get lost if
      there are no subsequent requests kick in.
      Signed-off-by: NShaohua Li <shli@fb.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      9ba52e58
  2. 24 4月, 2015 2 次提交
  3. 17 4月, 2015 1 次提交
  4. 16 4月, 2015 1 次提交
    • C
      blk-mq: reduce unnecessary software queue looping · 889fa31f
      Chong Yuan 提交于
      In flush_busy_ctxs() and blk_mq_hctx_has_pending(), regardless of how many
      ctxs assigned to one hctx, they will all loop hctx->ctx_map.map_size
      times. Here hctx->ctx_map.map_size is a const ALIGN(nr_cpu_ids, 8) / 8.
      Especially, flush_busy_ctxs() is in hot code path. And it's unnecessary.
      Change ->map_size to contain the actually mapped software queues, so we
      only loop for as many iterations as we have to.
      
      And remove cpumask setting and nr_ctx count in blk_mq_init_cpu_queues()
      since they are all re-done in blk_mq_map_swqueue().
      blk_mq_map_swqueue().
      Signed-off-by: NChong Yuan <chong.yuan@memblaze.com>
      Reviewed-by: NWenbo Wang <wenbo.wang@memblaze.com>
      
      Updated by me for formatting and commenting.
      Signed-off-by: NJens Axboe <axboe@fb.com>
      889fa31f
  5. 12 4月, 2015 1 次提交
    • L
      blk-mq: initialize 'struct request' and associated data to zero · ac211175
      Linus Torvalds 提交于
      Jan Engelhardt reports a strange oops with an invalid ->sense_buffer
      pointer in scsi_init_cmd_errh() with the blk-mq code.
      
      The sense_buffer pointer should have been initialized by the call to
      scsi_init_request() from blk_mq_init_rq_map(), but there seems to be
      some non-repeatable memory corruptor.
      
      This patch makes sure we initialize the whole struct request allocation
      (and the associated 'struct scsi_cmnd' for the SCSI case) to zero, by
      using __GFP_ZERO in the allocation.  The old code initialized a couple
      of individual fields, leaving the rest undefined (although many of them
      are then initialized in later phases, like blk_mq_rq_ctx_init() etc.
      
      It's not entirely clear why this matters, but it's the rigth thing to do
      regardless, and with 4.0 imminent this is the defensive "let's just make
      sure everything is initialized properly" patch.
      Tested-by: NJan Engelhardt <jengelh@inai.de>
      Acked-by: NJens Axboe <axboe@kernel.dk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ac211175
  6. 30 3月, 2015 2 次提交
  7. 13 3月, 2015 4 次提交
  8. 11 2月, 2015 1 次提交
  9. 30 1月, 2015 2 次提交
  10. 24 1月, 2015 1 次提交
    • S
      blk-mq: add tag allocation policy · 24391c0d
      Shaohua Li 提交于
      This is the blk-mq part to support tag allocation policy. The default
      allocation policy isn't changed (though it's not a strict FIFO). The new
      policy is round-robin for libata. But it's a try-best implementation. If
      multiple tasks are competing, the tags returned will be mixed (which is
      unavoidable even with !mq, as requests from different tasks can be
      mixed in queue)
      
      Cc: Jens Axboe <axboe@fb.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: NShaohua Li <shli@fb.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      24391c0d
  11. 21 1月, 2015 1 次提交
  12. 08 1月, 2015 7 次提交
  13. 03 1月, 2015 1 次提交
  14. 01 1月, 2015 1 次提交
  15. 21 12月, 2014 2 次提交
  16. 09 12月, 2014 1 次提交
  17. 01 12月, 2014 1 次提交
  18. 24 11月, 2014 1 次提交
  19. 18 11月, 2014 2 次提交
  20. 12 11月, 2014 3 次提交
  21. 05 11月, 2014 1 次提交
  22. 30 10月, 2014 2 次提交
    • J
      blk-mq: add BLK_MQ_F_DEFER_ISSUE support flag · e167dfb5
      Jens Axboe 提交于
      Drivers can now tell blk-mq if they take advantage of the deferred
      issue through 'last' or not. If they do, don't do queue-direct
      for sync IO. This is a preparation patch for the nvme conversion.
      Signed-off-by: NJens Axboe <axboe@fb.com>
      e167dfb5
    • 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
  23. 14 10月, 2014 1 次提交