1. 30 9月, 2022 2 次提交
  2. 29 9月, 2022 1 次提交
  3. 27 9月, 2022 3 次提交
  4. 24 9月, 2022 3 次提交
  5. 23 9月, 2022 1 次提交
  6. 22 9月, 2022 10 次提交
  7. 21 9月, 2022 2 次提交
  8. 20 9月, 2022 2 次提交
  9. 16 9月, 2022 2 次提交
  10. 13 9月, 2022 1 次提交
  11. 12 9月, 2022 2 次提交
    • Y
      blk-throttle: fix that io throttle can only work for single bio · 320fb0f9
      Yu Kuai 提交于
      Test scripts:
      cd /sys/fs/cgroup/blkio/
      echo "8:0 1024" > blkio.throttle.write_bps_device
      echo $$ > cgroup.procs
      dd if=/dev/zero of=/dev/sda bs=10k count=1 oflag=direct &
      dd if=/dev/zero of=/dev/sda bs=10k count=1 oflag=direct &
      
      Test result:
      10240 bytes (10 kB, 10 KiB) copied, 10.0134 s, 1.0 kB/s
      10240 bytes (10 kB, 10 KiB) copied, 10.0135 s, 1.0 kB/s
      
      The problem is that the second bio is finished after 10s instead of 20s.
      
      Root cause:
      1) second bio will be flagged:
      
      __blk_throtl_bio
       while (true) {
        ...
        if (sq->nr_queued[rw]) -> some bio is throttled already
         break
       };
       bio_set_flag(bio, BIO_THROTTLED); -> flag the bio
      
      2) flagged bio will be dispatched without waiting:
      
      throtl_dispatch_tg
       tg_may_dispatch
        tg_with_in_bps_limit
         if (bps_limit == U64_MAX || bio_flagged(bio, BIO_THROTTLED))
          *wait = 0; -> wait time is zero
          return true;
      
      commit 9f5ede3c ("block: throttle split bio in case of iops limit")
      support to count split bios for iops limit, thus it adds flagged bio
      checking in tg_with_in_bps_limit() so that split bios will only count
      once for bps limit, however, it introduce a new problem that io throttle
      won't work if multiple bios are throttled.
      
      In order to fix the problem, handle iops/bps limit in different ways:
      
      1) for iops limit, there is no flag to record if the bio is throttled,
         and iops is always applied.
      2) for bps limit, original bio will be flagged with BIO_BPS_THROTTLED,
         and io throttle will ignore bio with the flag.
      
      Noted this patch also remove the code to set flag in __bio_clone(), it's
      introduced in commit 111be883 ("block-throttle: avoid double
      charge"), and author thinks split bio can be resubmited and throttled
      again, which is wrong because split bio will continue to dispatch from
      caller.
      
      Fixes: 9f5ede3c ("block: throttle split bio in case of iops limit")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NYu Kuai <yukuai3@huawei.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Link: https://lore.kernel.org/r/20220829022240.3348319-2-yukuai1@huaweicloud.comSigned-off-by: NJens Axboe <axboe@kernel.dk>
      320fb0f9
    • K
      sbitmap: fix batched wait_cnt accounting · 4acb8341
      Keith Busch 提交于
      Batched completions can clear multiple bits, but we're only decrementing
      the wait_cnt by one each time. This can cause waiters to never be woken,
      stalling IO. Use the batched count instead.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=215679Signed-off-by: NKeith Busch <kbusch@kernel.org>
      Link: https://lore.kernel.org/r/20220909184022.1709476-1-kbusch@fb.comSigned-off-by: NJens Axboe <axboe@kernel.dk>
      4acb8341
  12. 11 9月, 2022 1 次提交
  13. 10 9月, 2022 1 次提交
  14. 08 9月, 2022 1 次提交
    • L
      fs: only do a memory barrier for the first set_buffer_uptodate() · 2f79cdfe
      Linus Torvalds 提交于
      Commit d4252071 ("add barriers to buffer_uptodate and
      set_buffer_uptodate") added proper memory barriers to the buffer head
      BH_Uptodate bit, so that anybody who tests a buffer for being up-to-date
      will be guaranteed to actually see initialized state.
      
      However, that commit didn't _just_ add the memory barrier, it also ended
      up dropping the "was it already set" logic that the BUFFER_FNS() macro
      had.
      
      That's conceptually the right thing for a generic "this is a memory
      barrier" operation, but in the case of the buffer contents, we really
      only care about the memory barrier for the _first_ time we set the bit,
      in that the only memory ordering protection we need is to avoid anybody
      seeing uninitialized memory contents.
      
      Any other access ordering wouldn't be about the BH_Uptodate bit anyway,
      and would require some other proper lock (typically BH_Lock or the folio
      lock).  A reader that races with somebody invalidating the buffer head
      isn't an issue wrt the memory ordering, it's a serialization issue.
      
      Now, you'd think that the buffer head operations don't matter in this
      day and age (and I certainly thought so), but apparently some loads
      still end up being heavy users of buffer heads.  In particular, the
      kernel test robot reported that not having this bit access optimization
      in place caused a noticeable direct IO performance regression on ext4:
      
        fxmark.ssd_ext4_no_jnl_DWTL_54_directio.works/sec -26.5% regression
      
      although you presumably need a fast disk and a lot of cores to actually
      notice.
      
      Link: https://lore.kernel.org/all/Yw8L7HTZ%2FdE2%2Fo9C@xsang-OptiPlex-9020/Reported-by: Nkernel test robot <oliver.sang@intel.com>
      Tested-by: NFengwei Yin <fengwei.yin@intel.com>
      Cc: Mikulas Patocka <mpatocka@redhat.com>
      Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
      Cc: stable@kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2f79cdfe
  15. 07 9月, 2022 3 次提交
  16. 06 9月, 2022 1 次提交
  17. 05 9月, 2022 3 次提交
  18. 04 9月, 2022 1 次提交