1. 14 7月, 2021 1 次提交
  2. 06 7月, 2021 2 次提交
  3. 03 7月, 2021 6 次提交
  4. 03 6月, 2021 5 次提交
  5. 26 4月, 2021 1 次提交
    • Y
      block: only update parent bi_status when bio fail · b9e7742d
      Yufen Yu 提交于
      stable inclusion
      from stable-5.10.31
      commit 1d2310d95fb8e29e69ebfc038919c968fbbdcb64
      bugzilla: 51792
      
      --------------------------------
      
      [ Upstream commit 3edf5346 ]
      
      For multiple split bios, if one of the bio is fail, the whole
      should return error to application. But we found there is a race
      between bio_integrity_verify_fn and bio complete, which return
      io success to application after one of the bio fail. The race as
      following:
      
      split bio(READ)          kworker
      
      nvme_complete_rq
      blk_update_request //split error=0
        bio_endio
          bio_integrity_endio
            queue_work(kintegrityd_wq, &bip->bip_work);
      
                               bio_integrity_verify_fn
                               bio_endio //split bio
                                __bio_chain_endio
                                   if (!parent->bi_status)
      
                                     <interrupt entry>
                                     nvme_irq
                                       blk_update_request //parent error=7
                                       req_bio_endio
                                          bio->bi_status = 7 //parent bio
                                     <interrupt exit>
      
                                     parent->bi_status = 0
                              parent->bi_end_io() // return bi_status=0
      
      The bio has been split as two: split and parent. When split
      bio completed, it depends on kworker to do endio, while
      bio_integrity_verify_fn have been interrupted by parent bio
      complete irq handler. Then, parent bio->bi_status which have
      been set in irq handler will overwrite by kworker.
      
      In fact, even without the above race, we also need to conside
      the concurrency beteen mulitple split bio complete and update
      the same parent bi_status. Normally, multiple split bios will
      be issued to the same hctx and complete from the same irq
      vector. But if we have updated queue map between multiple split
      bios, these bios may complete on different hw queue and different
      irq vector. Then the concurrency update parent bi_status may
      cause the final status error.
      Suggested-by: NKeith Busch <kbusch@kernel.org>
      Signed-off-by: NYufen Yu <yuyufen@huawei.com>
      Reviewed-by: NMing Lei <ming.lei@redhat.com>
      Link: https://lore.kernel.org/r/20210331115359.1125679-1-yuyufen@huawei.comSigned-off-by: NJens Axboe <axboe@kernel.dk>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NChen Jun <chenjun102@huawei.com>
      Acked-by: N  Weilong Chen <chenweilong@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      b9e7742d
  6. 19 4月, 2021 4 次提交
  7. 09 4月, 2021 5 次提交
  8. 09 3月, 2021 2 次提交
    • L
      bfq-iosched: Revert "bfq: Fix computation of shallow depth" · 53f3de01
      Lin Feng 提交于
      stable inclusion
      from stable-5.10.17
      commit d93178df8f754b8ae5b5c804edcd6d4b64aad5a7
      bugzilla: 48169
      
      --------------------------------
      
      [ Upstream commit 388c705b ]
      
      This reverts commit 6d4d2735.
      
      bfq.limit_depth passes word_depths[] as shallow_depth down to sbitmap core
      sbitmap_get_shallow, which uses just the number to limit the scan depth of
      each bitmap word, formula:
      scan_percentage_for_each_word = shallow_depth / (1 << sbimap->shift) * 100%
      
      That means the comments's percentiles 50%, 75%, 18%, 37% of bfq are correct.
      But after commit patch 'bfq: Fix computation of shallow depth', we use
      sbitmap.depth instead, as a example in following case:
      
      sbitmap.depth = 256, map_nr = 4, shift = 6; sbitmap_word.depth = 64.
      The resulsts of computed bfqd->word_depths[] are {128, 192, 48, 96}, and
      three of the numbers exceed core dirver's 'sbitmap_word.depth=64' limit
      nothing.
      Signed-off-by: NLin Feng <linf@wangsu.com>
      Reviewed-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
      53f3de01
    • B
      blk-cgroup: Use cond_resched() when destroy blkgs · 6881cf57
      Baolin Wang 提交于
      stable inclusion
      from stable-5.10.16
      commit fb8f9b2f7d229a8bc74db1cfa53814a0d6b42b7f
      bugzilla: 48168
      
      --------------------------------
      
      [ Upstream commit 6c635cae ]
      
      On !PREEMPT kernel, we can get below softlockup when doing stress
      testing with creating and destroying block cgroup repeatly. The
      reason is it may take a long time to acquire the queue's lock in
      the loop of blkcg_destroy_blkgs(), or the system can accumulate a
      huge number of blkgs in pathological cases. We can add a need_resched()
      check on each loop and release locks and do cond_resched() if true
      to avoid this issue, since the blkcg_destroy_blkgs() is not called
      from atomic contexts.
      
      [ 4757.010308] watchdog: BUG: soft lockup - CPU#11 stuck for 94s!
      [ 4757.010698] Call trace:
      [ 4757.010700]  blkcg_destroy_blkgs+0x68/0x150
      [ 4757.010701]  cgwb_release_workfn+0x104/0x158
      [ 4757.010702]  process_one_work+0x1bc/0x3f0
      [ 4757.010704]  worker_thread+0x164/0x468
      [ 4757.010705]  kthread+0x108/0x138
      Suggested-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NBaolin Wang <baolin.wang@linux.alibaba.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
      6881cf57
  9. 09 2月, 2021 1 次提交
  10. 28 1月, 2021 2 次提交
  11. 27 1月, 2021 6 次提交
  12. 18 1月, 2021 1 次提交
  13. 05 12月, 2020 1 次提交
    • M
      dm: fix IO splitting · 3ee16db3
      Mike Snitzer 提交于
      Commit 882ec4e6 ("dm table: stack 'chunk_sectors' limit to account
      for target-specific splitting") caused a couple regressions:
      1) Using lcm_not_zero() when stacking chunk_sectors was a bug because
         chunk_sectors must reflect the most limited of all devices in the
         IO stack.
      2) DM targets that set max_io_len but that do _not_ provide an
         .iterate_devices method no longer had there IO split properly.
      
      And commit 5091cdec ("dm: change max_io_len() to use
      blk_max_size_offset()") also caused a regression where DM no longer
      supported varied (per target) IO splitting. The implication being the
      potential for severely reduced performance for IO stacks that use a DM
      target like dm-cache to hide performance limitations of a slower
      device (e.g. one that requires 4K IO splitting).
      
      Coming full circle: Fix all these issues by discontinuing stacking
      chunk_sectors up using ti->max_io_len in dm_calculate_queue_limits(),
      add optional chunk_sectors override argument to blk_max_size_offset()
      and update DM's max_io_len() to pass ti->max_io_len to its
      blk_max_size_offset() call.
      
      Passing in an optional chunk_sectors override to blk_max_size_offset()
      allows for code reuse of block's centralized calculation for max IO
      size based on provided offset and split boundary.
      
      Fixes: 882ec4e6 ("dm table: stack 'chunk_sectors' limit to account for target-specific splitting")
      Fixes: 5091cdec ("dm: change max_io_len() to use blk_max_size_offset()")
      Cc: stable@vger.kernel.org
      Reported-by: NJohn Dorminy <jdorminy@redhat.com>
      Reported-by: NBruce Johnston <bjohnsto@redhat.com>
      Reported-by: NKirill Tkhai <ktkhai@virtuozzo.com>
      Reviewed-by: NJohn Dorminy <jdorminy@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Reviewed-by: NJens Axboe <axboe@kernel.dk>
      3ee16db3
  14. 02 12月, 2020 1 次提交
  15. 21 11月, 2020 1 次提交
    • E
      block/keyslot-manager: prevent crash when num_slots=1 · 47a84653
      Eric Biggers 提交于
      If there is only one keyslot, then blk_ksm_init() computes
      slot_hashtable_size=1 and log_slot_ht_size=0.  This causes
      blk_ksm_find_keyslot() to crash later because it uses
      hash_ptr(key, log_slot_ht_size) to find the hash bucket containing the
      key, and hash_ptr() doesn't support the bits == 0 case.
      
      Fix this by making the hash table always have at least 2 buckets.
      
      Tested by running:
      
          kvm-xfstests -c ext4 -g encrypt -m inlinecrypt \
                       -o blk-crypto-fallback.num_keyslots=1
      
      Fixes: 1b262839 ("block: Keyslot Manager for Inline Encryption")
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      47a84653
  16. 15 11月, 2020 1 次提交