1. 22 11月, 2019 1 次提交
    • K
      block: add iostat counters for flush requests · b6866318
      Konstantin Khlebnikov 提交于
      Requests that triggers flushing volatile writeback cache to disk (barriers)
      have significant effect to overall performance.
      
      Block layer has sophisticated engine for combining several flush requests
      into one. But there is no statistics for actual flushes executed by disk.
      Requests which trigger flushes usually are barriers - zero-size writes.
      
      This patch adds two iostat counters into /sys/class/block/$dev/stat and
      /proc/diskstats - count of completed flush requests and their total time.
      Signed-off-by: NKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      b6866318
  2. 21 11月, 2019 1 次提交
  3. 19 11月, 2019 1 次提交
  4. 18 11月, 2019 1 次提交
  5. 14 11月, 2019 1 次提交
  6. 08 11月, 2019 8 次提交
  7. 07 11月, 2019 5 次提交
  8. 06 11月, 2019 1 次提交
  9. 05 11月, 2019 1 次提交
  10. 04 11月, 2019 4 次提交
  11. 02 11月, 2019 1 次提交
    • M
      blk-mq: avoid sysfs buffer overflow with too many CPU cores · 8962842c
      Ming Lei 提交于
      It is reported that sysfs buffer overflow can be triggered if the system
      has too many CPU cores(>841 on 4K PAGE_SIZE) when showing CPUs of
      hctx via /sys/block/$DEV/mq/$N/cpu_list.
      
      Use snprintf to avoid the potential buffer overflow.
      
      This version doesn't change the attribute format, and simply stops
      showing CPU numbers if the buffer is going to overflow.
      
      Cc: stable@vger.kernel.org
      Fixes: 676141e4("blk-mq: don't dump CPU -> hw queue map on driver load")
      Signed-off-by: NMing Lei <ming.lei@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      8962842c
  12. 01 11月, 2019 2 次提交
  13. 26 10月, 2019 4 次提交
    • A
      blk-mq: remove needless goto from blk_mq_get_driver_tag · 1fead718
      André Almeida 提交于
      The only usage of the label "done" is when (rq->tag != -1) at the
      beginning of the function. Rather than jumping to label, we can just
      remove this label and execute the code at the "if". Besides that, the
      code that would be executed after the label "done" is the return of the
      logical expression (rq->tag != -1) but since we are already inside the
      if, we now that this is true. Remove the label and replace the goto with
      the proper result of the label.
      Signed-off-by: NAndré Almeida <andrealmeid@collabora.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      1fead718
    • B
      block: Reduce the amount of memory used for tag sets · f7e76dbc
      Bart Van Assche 提交于
      Instead of allocating an array of size nr_cpu_ids for set->tags, allocate
      an array of size set->nr_hw_queues. This patch improves behavior that was
      introduced by commit 868f2f0b ("blk-mq: dynamic h/w context count").
      
      Reallocating tag sets from inside __blk_mq_update_nr_hw_queues() is safe
      because:
      - All request queues that share the tag sets are frozen before the tag sets
        are reallocated.
      - blk_mq_queue_tag_busy_iter() holds q->q_usage_counter while active and
        hence is serialized against __blk_mq_update_nr_hw_queues().
      
      Cc: Keith Busch <keith.busch@intel.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Ming Lei <ming.lei@redhat.com>
      Cc: Hannes Reinecke <hare@suse.com>
      Cc: Johannes Thumshirn <jthumshirn@suse.de>
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      f7e76dbc
    • B
      block: Reduce the amount of memory required per request queue · ac0d6b92
      Bart Van Assche 提交于
      Instead of always allocating at least nr_cpu_ids hardware queues per request
      queue, reallocate q->queue_hw_ctx if it has to grow. This patch improves
      behavior that was introduced by commit 868f2f0b ("blk-mq: dynamic h/w
      context count").
      
      Cc: Keith Busch <keith.busch@intel.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Ming Lei <ming.lei@redhat.com>
      Cc: Hannes Reinecke <hare@suse.com>
      Cc: Johannes Thumshirn <jthumshirn@suse.de>
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      ac0d6b92
    • B
      block: Remove the synchronize_rcu() call from __blk_mq_update_nr_hw_queues() · a9a80808
      Bart Van Assche 提交于
      Since the blk_mq_{,un}freeze_queue() calls in __blk_mq_update_nr_hw_queues()
      already serialize __blk_mq_update_nr_hw_queues() against
      blk_mq_queue_tag_busy_iter(), the synchronize_rcu() call in
      __blk_mq_update_nr_hw_queues() is not necessary. Hence remove it.
      
      Note: the synchronize_rcu() call in __blk_mq_update_nr_hw_queues() was
      introduced by commit f5bbbbe4 ("blk-mq: sync the update nr_hw_queues with
      blk_mq_queue_tag_busy_iter"). Commit 530ca2c9 ("blk-mq: Allow blocking
      queue tag iter callbacks") removed the rcu_read_{,un}lock() calls that
      correspond to the synchronize_rcu() call in __blk_mq_update_nr_hw_queues().
      Reviewed-by: NMing Lei <ming.lei@redhat.com>
      Cc: Jianchao Wang <jianchao.w.wang@oracle.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Hannes Reinecke <hare@suse.com>
      Cc: Johannes Thumshirn <jthumshirn@suse.de>
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      a9a80808
  14. 16 10月, 2019 2 次提交
    • T
      blk-rq-qos: fix first node deletion of rq_qos_del() · 307f4065
      Tejun Heo 提交于
      rq_qos_del() incorrectly assigns the node being deleted to the head if
      it was the first on the list in the !prev path.  Fix it by iterating
      with ** instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Josef Bacik <josef@toxicpanda.com>
      Fixes: a7905043 ("blk-rq-qos: refactor out common elements of blk-wbt")
      Cc: stable@vger.kernel.org # v4.19+
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      307f4065
    • T
      blkcg: Fix multiple bugs in blkcg_activate_policy() · 9d179b86
      Tejun Heo 提交于
      blkcg_activate_policy() has the following bugs.
      
      * cf09a8ee ("blkcg: pass @q and @blkcg into
        blkcg_pol_alloc_pd_fn()") added @blkcg to ->pd_alloc_fn(); however,
        blkcg_activate_policy() ends up using pd's allocated for the root
        blkcg for all preallocations, so ->pd_init_fn() for non-root blkcgs
        can be passed in pd's which are allocated for the root blkcg.
      
        For blk-iocost, this means that ->pd_init_fn() can write beyond the
        end of the allocated object as it determines the length of the flex
        array at the end based on the blkcg's nesting level.
      
      * Each pd is initialized as they get allocated.  If alloc fails, the
        policy will get freed with pd's initialized on it.
      
      * After the above partial failure, the partial pds are not freed.
      
      This patch fixes all the above issues by
      
      * Restructuring blkcg_activate_policy() so that alloc and init passes
        are separate.  Init takes place only after all allocs succeeded and
        on failure all allocated pds are freed.
      
      * Unifying and fixing the cleanup of the remaining pd_prealloc.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Fixes: cf09a8ee ("blkcg: pass @q and @blkcg into blkcg_pol_alloc_pd_fn()")
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      9d179b86
  15. 15 10月, 2019 1 次提交
  16. 11 10月, 2019 1 次提交
  17. 08 10月, 2019 1 次提交
  18. 07 10月, 2019 4 次提交