An error occurred fetching the project authors.
  1. 22 Sep, 2023 2 commits
  2. 11 Sep, 2023 1 commit
  3. 22 Aug, 2023 3 commits
  4. 19 Aug, 2023 1 commit
  5. 25 Jul, 2023 1 commit
    • Bart Van Assche's avatar
      block: Improve performance for BLK_MQ_F_BLOCKING drivers · 65a558f6
      Bart Van Assche authored
      blk_mq_run_queue() runs the queue asynchronously if BLK_MQ_F_BLOCKING
      has been set. This is suboptimal since running the queue asynchronously
      is slower than running the queue synchronously. This patch modifies
      blk_mq_run_queue() as follows if BLK_MQ_F_BLOCKING has been set:
      - Run the queue synchronously if it is allowed to sleep.
      - Run the queue asynchronously if it is not allowed to sleep.
      Additionally, blk_mq_run_hw_queue(hctx, false) calls are modified into
      blk_mq_run_hw_queue(hctx, hctx->flags & BLK_MQ_F_BLOCKING) if the caller
      may be invoked from atomic context.
      
      The following caller chains have been reviewed:
      
      blk_mq_run_hw_queue(hctx, false)
        blk_mq_get_tag()      /* may sleep, hence the functions it calls may also sleep */
        blk_execute_rq()             /* may sleep */
        blk_mq_run_hw_queues(q, async=false)
          blk_freeze_queue_start()   /* may sleep */
          blk_mq_requeue_work()      /* may sleep */
          scsi_kick_queue()
            scsi_requeue_run_queue() /* may sleep */
            scsi_run_host_queues()
              scsi_ioctl_reset()     /* may sleep */
        blk_mq_insert_requests(hctx, ctx, list, run_queue_async=false)
          blk_mq_dispatch_plug_list(plug, from_sched=false)
            blk_mq_flush_plug_list(plug, from_schedule=false)
              __blk_flush_plug(plug, from_schedule=false)
      	blk_add_rq_to_plug()
      	  blk_mq_submit_bio()  /* may sleep if REQ_NOWAIT has not been set */
        blk_mq_plug_issue_direct()
          blk_mq_flush_plug_list()   /* see above */
        blk_mq_dispatch_plug_list(plug, from_sched=false)
          blk_mq_flush_plug_list()   /* see above */
        blk_mq_try_issue_directly()
          blk_mq_submit_bio()        /* may sleep if REQ_NOWAIT has not been set */
        blk_mq_try_issue_list_directly(hctx, list)
          blk_mq_insert_requests() /* see above */
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Ming Lei <ming.lei@redhat.com>
      Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
      Link: https://lore.kernel.org/r/20230721172731.955724-4-bvanassche@acm.orgSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
      65a558f6
  6. 17 Jul, 2023 1 commit
  7. 14 Jul, 2023 1 commit
    • Ross Lagerwall's avatar
      blk-mq: Fix stall due to recursive flush plug · 70904263
      Ross Lagerwall authored
      We have seen rare IO stalls as follows:
      
      * blk_mq_plug_issue_direct() is entered with an mq_list containing two
      requests.
      * For the first request, it sets last == false and enters the driver's
      queue_rq callback.
      * The driver queue_rq callback indirectly calls schedule() which calls
      blk_flush_plug(). This may happen if the driver has the
      BLK_MQ_F_BLOCKING flag set and is allowed to sleep in ->queue_rq.
      * blk_flush_plug() handles the remaining request in the mq_list. mq_list
      is now empty.
      * The original call to queue_rq resumes (with last == false).
      * The loop in blk_mq_plug_issue_direct() terminates because there are no
      remaining requests in mq_list.
      
      The IO is now stalled because the last request submitted to the driver
      had last == false and there was no subsequent call to commit_rqs().
      
      Fix this by returning early in blk_mq_flush_plug_list() if rq_count is 0
      which it will be in the recursive case, rather than checking if the
      mq_list is empty. At the same time, adjust one of the callers to skip
      the mq_list empty check as it is not necessary.
      
      Fixes: dc5fc361 ("block: attempt direct issue of plug list")
      Signed-off-by: default avatarRoss Lagerwall <ross.lagerwall@citrix.com>
      Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
      Link: https://lore.kernel.org/r/20230714101106.3635611-1-ross.lagerwall@citrix.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
      70904263
  8. 13 Jul, 2023 1 commit
  9. 28 Jun, 2023 1 commit
  10. 25 Jun, 2023 1 commit
  11. 21 Jun, 2023 1 commit
  12. 16 Jun, 2023 1 commit
  13. 14 Jun, 2023 1 commit
  14. 03 Jun, 2023 1 commit
    • Tian Lan's avatar
      blk-mq: fix blk_mq_hw_ctx active request accounting · ddad5933
      Tian Lan authored
      The nr_active counter continues to increase over time which causes the
      blk_mq_get_tag to hang until the thread is rescheduled to a different
      core despite there are still tags available.
      
      kernel-stack
      
        INFO: task inboundIOReacto:3014879 blocked for more than 2 seconds
        Not tainted 6.1.15-amd64 #1 Debian 6.1.15~debian11
        "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
        task:inboundIOReacto state:D stack:0  pid:3014879 ppid:4557 flags:0x00000000
          Call Trace:
          <TASK>
          __schedule+0x351/0xa20
          scheduler+0x5d/0xe0
          io_schedule+0x42/0x70
          blk_mq_get_tag+0x11a/0x2a0
          ? dequeue_task_stop+0x70/0x70
          __blk_mq_alloc_requests+0x191/0x2e0
      
      kprobe output showing RQF_MQ_INFLIGHT bit is not cleared before
      __blk_mq_free_request being called.
      
        320    320  kworker/29:1H __blk_mq_free_request rq_flags 0x220c0 in-flight 1
               b'__blk_mq_free_request+0x1 [kernel]'
               b'bt_iter+0x50 [kernel]'
               b'blk_mq_queue_tag_busy_iter+0x318 [kernel]'
               b'blk_mq_timeout_work+0x7c [kernel]'
               b'process_one_work+0x1c4 [kernel]'
               b'worker_thread+0x4d [kernel]'
               b'kthread+0xe6 [kernel]'
               b'ret_from_fork+0x1f [kernel]'
      Signed-off-by: default avatarTian Lan <tian.lan@twosigma.com>
      Fixes: 2e315dc0 ("blk-mq: grab rq->refcount before calling ->fn in blk_mq_tagset_busy_iter")
      Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
      Link: https://lore.kernel.org/r/20230513221227.497327-1-tilan7663@gmail.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
      ddad5933
  15. 24 May, 2023 1 commit
  16. 20 May, 2023 3 commits
  17. 19 May, 2023 3 commits
  18. 20 Apr, 2023 1 commit
  19. 13 Apr, 2023 15 commits