1. 04 Apr, 2017 32 commits
  2. 31 Mar, 2017 1 commit
  3. 30 Mar, 2017 4 commits
  4. 29 Mar, 2017 3 commits
    • Jens Axboe's avatar
      blk-mq: include errors in did_work calculation · 3e8a7069
      Jens Axboe authored
      Currently we return true in blk_mq_dispatch_rq_list() if we queued IO
      successfully, but we really want to return whether or not the we made
      progress. Progress includes if we got an error return.  If we don't,
      this can lead to a hang in blk_mq_sched_dispatch_requests() when a
      driver is draining IO by returning BLK_MQ_QUEUE_ERROR instead of
      manually ending the IO in error and return BLK_MQ_QUEUE_OK.
      Tested-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Reviewed-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: default avatarOmar Sandoval <osandov@fb.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      3e8a7069
    • Josef Bacik's avatar
      block-mq: don't re-queue if we get a queue error · b58e1769
      Josef Bacik authored
      When try to issue a request directly and we fail we will requeue the
      request, but call blk_mq_end_request() as well.  This leads to the
      completed request being on a queuelist and getting ended twice, which
      causes list corruption in schedulers and other shenanigans.
      Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
      Reviewed-by: default avatarMing Lei <tom.leiming@gmail.com>
      Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      b58e1769
    • Tahsin Erdogan's avatar
      blkcg: allocate struct blkcg_gq outside request queue spinlock · 457e490f
      Tahsin Erdogan authored
      blkg_conf_prep() currently calls blkg_lookup_create() while holding
      request queue spinlock. This means allocating memory for struct
      blkcg_gq has to be made non-blocking. This causes occasional -ENOMEM
      failures in call paths like below:
      
        pcpu_alloc+0x68f/0x710
        __alloc_percpu_gfp+0xd/0x10
        __percpu_counter_init+0x55/0xc0
        cfq_pd_alloc+0x3b2/0x4e0
        blkg_alloc+0x187/0x230
        blkg_create+0x489/0x670
        blkg_lookup_create+0x9a/0x230
        blkg_conf_prep+0x1fb/0x240
        __cfqg_set_weight_device.isra.105+0x5c/0x180
        cfq_set_weight_on_dfl+0x69/0xc0
        cgroup_file_write+0x39/0x1c0
        kernfs_fop_write+0x13f/0x1d0
        __vfs_write+0x23/0x120
        vfs_write+0xc2/0x1f0
        SyS_write+0x44/0xb0
        entry_SYSCALL_64_fastpath+0x18/0xad
      
      In the code path above, percpu allocator cannot call vmalloc() due to
      queue spinlock.
      
      A failure in this call path gives grief to tools which are trying to
      configure io weights. We see occasional failures happen shortly after
      reboots even when system is not under any memory pressure. Machines
      with a lot of cpus are more vulnerable to this condition.
      
      Do struct blkcg_gq allocations outside the queue spinlock to allow
      blocking during memory allocations.
      Suggested-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarTahsin Erdogan <tahsin@google.com>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      457e490f