Skip to content
Snippets Groups Projects
  1. Jun 09, 2015
  2. May 04, 2015
    • Shaohua Li's avatar
      blk-mq: don't lose requests if a stopped queue restarts · 9ba52e58
      Shaohua Li authored
      
      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: default avatarShaohua Li <shli@fb.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      9ba52e58
  3. Apr 23, 2015
  4. Apr 17, 2015
  5. Apr 15, 2015
    • Chong Yuan's avatar
      blk-mq: reduce unnecessary software queue looping · 889fa31f
      Chong Yuan authored
      
      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: default avatarChong Yuan <chong.yuan@memblaze.com>
      Reviewed-by: default avatarWenbo Wang <wenbo.wang@memblaze.com>
      
      Updated by me for formatting and commenting.
      
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      889fa31f
  6. Apr 11, 2015
    • Linus Torvalds's avatar
      blk-mq: initialize 'struct request' and associated data to zero · ac211175
      Linus Torvalds authored
      
      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: default avatarJan Engelhardt <jengelh@inai.de>
      Acked-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ac211175
  7. Mar 30, 2015
  8. Mar 13, 2015
  9. Feb 10, 2015
  10. Jan 29, 2015
  11. Jan 23, 2015
    • Shaohua Li's avatar
      blk-mq: add tag allocation policy · 24391c0d
      Shaohua Li authored
      
      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: default avatarShaohua Li <shli@fb.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      24391c0d
  12. Jan 20, 2015
  13. Jan 08, 2015
  14. Jan 07, 2015
  15. Jan 02, 2015
  16. Dec 31, 2014
  17. Dec 20, 2014
  18. Dec 09, 2014
  19. Dec 01, 2014
  20. Nov 24, 2014
  21. Nov 17, 2014
  22. Nov 12, 2014
  23. Nov 11, 2014
  24. Nov 04, 2014
  25. Oct 29, 2014
    • Jens Axboe's avatar
      blk-mq: add BLK_MQ_F_DEFER_ISSUE support flag · e167dfb5
      Jens Axboe authored
      
      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: default avatarJens Axboe <axboe@fb.com>
      e167dfb5
    • Jens Axboe's avatar
      blk-mq: add a 'list' parameter to ->queue_rq() · 74c45052
      Jens Axboe authored
      
      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: default avatarJens Axboe <axboe@fb.com>
      74c45052
Loading