1. 08 4月, 2017 2 次提交
    • B
      scsi: Avoid that SCSI queues get stuck · 36e3cf27
      Bart Van Assche 提交于
      If a .queue_rq() function returns BLK_MQ_RQ_QUEUE_BUSY then the block
      driver that implements that function is responsible for rerunning the
      hardware queue once requests can be queued again successfully.
      
      commit 52d7f1b5 ("blk-mq: Avoid that requeueing starts stopped
      queues") removed the blk_mq_stop_hw_queue() call from scsi_queue_rq()
      for the BLK_MQ_RQ_QUEUE_BUSY case. Hence change all calls to functions
      that are intended to rerun a busy queue such that these examine all
      hardware queues instead of only stopped queues.
      
      Since no other functions than scsi_internal_device_block() and
      scsi_internal_device_unblock() should ever stop or restart a SCSI
      queue, change the blk_mq_delay_queue() call into a
      blk_mq_delay_run_hw_queue() call.
      
      Fixes: commit 52d7f1b5 ("blk-mq: Avoid that requeueing starts stopped queues")
      Fixes: commit 7e79dadc ("blk-mq: stop hardware queue in blk_mq_delay_queue()")
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Sagi Grimberg <sagi@grimberg.me>
      Cc: Long Li <longli@microsoft.com>
      Cc: K. Y. Srinivasan <kys@microsoft.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      36e3cf27
    • B
      blk-mq: Introduce blk_mq_delay_run_hw_queue() · 7587a5ae
      Bart Van Assche 提交于
      Introduce a function that runs a hardware queue unconditionally
      after a delay. Note: there is already a function that stops and
      restarts a hardware queue after a delay, namely blk_mq_delay_queue().
      
      This function will be used in the next patch in this series.
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Long Li <longli@microsoft.com>
      Cc: K. Y. Srinivasan <kys@microsoft.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      7587a5ae
  2. 07 4月, 2017 5 次提交
    • O
      blk-mq: remap queues when adding/removing hardware queues · ebe8bddb
      Omar Sandoval 提交于
      blk_mq_update_nr_hw_queues() used to remap hardware queues, which is the
      behavior that drivers expect. However, commit 4e68a011 changed
      blk_mq_queue_reinit() to not remap queues for the case of CPU
      hotplugging, inadvertently making blk_mq_update_nr_hw_queues() not remap
      queues as well. This breaks, for example, NBD's multi-connection mode,
      leaving the added hardware queues unused. Fix it by making
      blk_mq_update_nr_hw_queues() explicitly remap the queues.
      
      Fixes: 4e68a011 ("blk-mq: don't redistribute hardware queues on a CPU hotplug event")
      Reviewed-by: NKeith Busch <keith.busch@intel.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NOmar Sandoval <osandov@fb.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      ebe8bddb
    • O
      blk-mq-sched: fix crash in switch error path · 54d5329d
      Omar Sandoval 提交于
      In elevator_switch(), if blk_mq_init_sched() fails, we attempt to fall
      back to the original scheduler. However, at this point, we've already
      torn down the original scheduler's tags, so this causes a crash. Doing
      the fallback like the legacy elevator path is much harder for mq, so fix
      it by just falling back to none, instead.
      Signed-off-by: NOmar Sandoval <osandov@fb.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      54d5329d
    • O
      blk-mq-sched: set up scheduler tags when bringing up new queues · 93252632
      Omar Sandoval 提交于
      If a new hardware queue is added at runtime, we don't allocate scheduler
      tags for it, leading to a crash. This hooks up the scheduler framework
      to blk_mq_{init,exit}_hctx() to make sure everything gets properly
      initialized/freed.
      Signed-off-by: NOmar Sandoval <osandov@fb.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      93252632
    • O
      blk-mq-sched: refactor scheduler initialization · 6917ff0b
      Omar Sandoval 提交于
      Preparation cleanup for the next couple of fixes, push
      blk_mq_sched_setup() and e->ops.mq.init_sched() into a helper.
      Signed-off-by: NOmar Sandoval <osandov@fb.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      6917ff0b
    • O
      blk-mq: use the right hctx when getting a driver tag fails · 81380ca1
      Omar Sandoval 提交于
      While dispatching requests, if we fail to get a driver tag, we mark the
      hardware queue as waiting for a tag and put the requests on a
      hctx->dispatch list to be run later when a driver tag is freed. However,
      blk_mq_dispatch_rq_list() may dispatch requests from multiple hardware
      queues if using a single-queue scheduler with a multiqueue device. If
      blk_mq_get_driver_tag() fails, it doesn't update the hardware queue we
      are processing. This means we end up using the hardware queue of the
      previous request, which may or may not be the same as that of the
      current request. If it isn't, the wrong hardware queue will end up
      waiting for a tag, and the requests will be on the wrong dispatch list,
      leading to a hang.
      
      The fix is twofold:
      
      1. Make sure we save which hardware queue we were trying to get a
         request for in blk_mq_get_driver_tag() regardless of whether it
         succeeds or not.
      2. Make blk_mq_dispatch_rq_list() take a request_queue instead of a
         blk_mq_hw_queue to make it clear that it must handle multiple
         hardware queues, since I've already messed this up on a couple of
         occasions.
      
      This didn't appear in testing with nvme and mq-deadline because nvme has
      more driver tags than the default number of scheduler tags. However,
      with the blk_mq_update_nr_hw_queues() fix, it showed up with nbd.
      Signed-off-by: NOmar Sandoval <osandov@fb.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      81380ca1
  3. 04 4月, 2017 1 次提交
  4. 02 4月, 2017 5 次提交
  5. 30 3月, 2017 4 次提交
    • M
      block: do not put mq context in blk_mq_alloc_request_hctx · ac77a0c4
      Minchan Kim 提交于
      In blk_mq_alloc_request_hctx, blk_mq_sched_get_request doesn't
      get sw context so we don't need to put the context with
      blk_mq_put_ctx. Unless, we will see preempt counter underflow.
      
      Cc: Omar Sandoval <osandov@fb.com>
      Signed-off-by: NMinchan Kim <minchan@kernel.org>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      ac77a0c4
    • L
      Merge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux · 89970a04
      Linus Torvalds 提交于
      Pull thermal management fixes from Zhang Rui:
      
       - Fix a potential deadlock in cpu_cooling driver, which was introduced
         in 4.11-rc1. (Matthew Wilcox)
      
       - Fix the cpu_cooling and devfreq_cooling code to handle possible error
         return value from OPP calls, together with three minor fixes in the
         same patch series. (Viresh Kumar)
      
      * 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
        thermal: cpu_cooling: Check OPP for errors
        thermal: cpu_cooling: Replace dev_warn with dev_err
        thermal: devfreq: Check OPP for errors
        thermal: devfreq_cooling: Replace dev_warn with dev_err
        thermal: devfreq: Simplify expression
        thermal: Fix potential deadlock in cpu_cooling
      89970a04
    • L
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 806276b7
      Linus Torvalds 提交于
      Pull block fixes from Jens Axboe:
       "Five fixes for this series:
      
         - a fix from me to ensure that blk-mq drivers that terminate IO in
           their ->queue_rq() handler by returning QUEUE_ERROR don't stall
           with a scheduler enabled.
      
         - four nbd fixes from Josef and Ratna, fixing various problems that
           are critical enough to go in for this cycle. They have been well
           tested"
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        nbd: replace kill_bdev() with __invalidate_device()
        nbd: set queue timeout properly
        nbd: set rq->errors to actual error code
        nbd: handle ERESTARTSYS properly
        blk-mq: include errors in did_work calculation
      806276b7
    • L
      Merge branch 'apw' (xfrm_user fixes) · 52b9c816
      Linus Torvalds 提交于
      Merge xfrm_user validation fixes from Andy Whitcroft:
       "Two patches we are applying to Ubuntu for XFRM_MSG_NEWAE validation
        issue reported by ZDI.
      
        The first of these is the primary fix, and the second is for a more
        theoretical issue that Kees pointed out when reviewing the first"
      
      * emailed patches from Andy Whitcroft <apw@canonical.com>:
        xfrm_user: validate XFRM_MSG_NEWAE incoming ESN size harder
        xfrm_user: validate XFRM_MSG_NEWAE XFRMA_REPLAY_ESN_VAL replay_window
      52b9c816
  6. 29 3月, 2017 16 次提交
  7. 28 3月, 2017 6 次提交
  8. 27 3月, 2017 1 次提交