1. 22 Jun, 2023 5 commits
  2. 16 Jun, 2023 20 commits
  3. 15 Jun, 2023 9 commits
  4. 14 Jun, 2023 4 commits
  5. 13 Jun, 2023 2 commits
    • Yu Kuai's avatar
      md/raid1-10: limit the number of plugged bio · 460af1f9
      Yu Kuai authored
      bio can be added to plug infinitely, and following writeback test can
      trigger huge amount of plugged bio:
      
      Test script:
      modprobe brd rd_nr=4 rd_size=10485760
      mdadm -CR /dev/md0 -l10 -n4 /dev/ram[0123] --assume-clean --bitmap=internal
      echo 0 > /proc/sys/vm/dirty_background_ratio
      fio -filename=/dev/md0 -ioengine=libaio -rw=write -bs=4k -numjobs=1 -iodepth=128 -name=test
      
      Test result:
      Monitor /sys/block/md0/inflight will found that inflight keep increasing
      until fio finish writing, after running for about 2 minutes:
      
      [root@fedora ~]# cat /sys/block/md0/inflight
             0  4474191
      
      Fix the problem by limiting the number of plugged bio based on the number
      of copies for original bio.
      Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
      Signed-off-by: default avatarSong Liu <song@kernel.org>
      Link: https://lore.kernel.org/r/20230529131106.2123367-8-yukuai1@huaweicloud.com
      460af1f9
    • Yu Kuai's avatar
      md/raid1-10: don't handle pluged bio by daemon thread · 9efcc2c3
      Yu Kuai authored
      current->bio_list will be set under submit_bio() context, in this case
      bitmap io will be added to the list and wait for current io submission to
      finish, while current io submission must wait for bitmap io to be done.
      commit 874807a8 ("md/raid1{,0}: fix deadlock in bitmap_unplug.") fix
      the deadlock by handling plugged bio by daemon thread.
      
      On the one hand, the deadlock won't exist after commit a214b949
      ("blk-mq: only flush requests from the plug in blk_mq_submit_bio"). On
      the other hand, current solution makes it impossible to flush plugged bio
      in raid1/10_make_request(), because this will cause that all the writes
      will goto daemon thread.
      
      In order to limit the number of plugged bio, commit 874807a8
      ("md/raid1{,0}: fix deadlock in bitmap_unplug.") is reverted, and the
      deadlock is fixed by handling bitmap io asynchronously.
      Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
      Signed-off-by: default avatarSong Liu <song@kernel.org>
      Link: https://lore.kernel.org/r/20230529131106.2123367-7-yukuai1@huaweicloud.com
      9efcc2c3