1. 05 12月, 2020 4 次提交
  2. 03 12月, 2020 4 次提交
    • Y
      blk-throttle: don't check whether or not lower limit is valid if... · acaf523a
      Yu Kuai 提交于
      blk-throttle: don't check whether or not lower limit is valid if CONFIG_BLK_DEV_THROTTLING_LOW is off
      
      blk_throtl_update_limit_valid() will search for descendants to see if
      'LIMIT_LOW' of bps/iops and READ/WRITE is nonzero. However, they're always
      zero if CONFIG_BLK_DEV_THROTTLING_LOW is not set, furthermore, a lot of
      time will be wasted to iterate descendants.
      
      Thus do nothing in blk_throtl_update_limit_valid() in such situation.
      Signed-off-by: NYu Kuai <yukuai3@huawei.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      acaf523a
    • J
      block: fix inflight statistics of part0 · b0d97557
      Jeffle Xu 提交于
      The inflight of partition 0 doesn't include inflight IOs to all
      sub-partitions, since currently mq calculates inflight of specific
      partition by simply camparing the value of the partition pointer.
      
      Thus the following case is possible:
      
      $ cat /sys/block/vda/inflight
             0        0
      $ cat /sys/block/vda/vda1/inflight
             0      128
      
      While single queue device (on a previous version, e.g. v3.10) has no
      this issue:
      
      $cat /sys/block/sda/sda3/inflight
             0       33
      $cat /sys/block/sda/inflight
             0       33
      
      Partition 0 should be specially handled since it represents the whole
      disk. This issue is introduced since commit bf0ddaba ("blk-mq: fix
      sysfs inflight counter").
      
      Besides, this patch can also fix the inflight statistics of part 0 in
      /proc/diskstats. Before this patch, the inflight statistics of part 0
      doesn't include that of sub partitions. (I have marked the 'inflight'
      field with asterisk.)
      
      $cat /proc/diskstats
       259       0 nvme0n1 45974469 0 367814768 6445794 1 0 1 0 *0* 111062 6445794 0 0 0 0 0 0
       259       2 nvme0n1p1 45974058 0 367797952 6445727 0 0 0 0 *33* 111001 6445727 0 0 0 0 0 0
      
      This is introduced since commit f299b7c7 ("blk-mq: provide internal
      in-flight variant").
      
      Fixes: bf0ddaba ("blk-mq: fix sysfs inflight counter")
      Fixes: f299b7c7 ("blk-mq: provide internal in-flight variant")
      Signed-off-by: NJeffle Xu <jefflexu@linux.alibaba.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      [axboe: adapt for 5.11 partition change]
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      b0d97557
    • P
      bio: optimise bvec iteration · 22b56c29
      Pavel Begunkov 提交于
      __bio_for_each_bvec(), __bio_for_each_segment() and bio_copy_data_iter()
      fall under conditions of bvec_iter_advance_single(), which is a faster
      and slimmer version of bvec_iter_advance(). Add
      bio_advance_iter_single() and convert them.
      Signed-off-by: NPavel Begunkov <asml.silence@gmail.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      22b56c29
    • P
      block: optimise for_each_bvec() advance · 6b6667aa
      Pavel Begunkov 提交于
      Because of how for_each_bvec() works it never advances across multiple
      entries at a time, so bvec_iter_advance() is an overkill. Add
      specialised bvec_iter_advance_single() that is faster. It also handles
      zero-len bvecs, so can kill bvec_iter_skip_zero_bvec().
      
         text    data     bss     dec     hex filename
      before:
        23977     805       0   24782    60ce lib/iov_iter.o
      before, bvec_iter_advance() w/o WARN_ONCE()
        22886     600       0   23486    5bbe ./lib/iov_iter.o
      after:
        21862     600       0   22462    57be lib/iov_iter.o
      Signed-off-by: NPavel Begunkov <asml.silence@gmail.com>
      Reviewed-by: NMing Lei <ming.lei@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      6b6667aa
  3. 02 12月, 2020 32 次提交