]> git.baikalelectronics.ru Git - kernel.git/commit
dm: fix bio splitting and its bio completion order for regular IO
authorMike Snitzer <snitzer@redhat.com>
Mon, 14 Sep 2020 17:04:19 +0000 (13:04 -0400)
committerMike Snitzer <snitzer@redhat.com>
Mon, 21 Sep 2020 23:42:20 +0000 (19:42 -0400)
commita847bca842a34b04d26fa5ae9e42184ed8f422a6
treeb585d0089216ae7feab34157b8432ae0edf3fa71
parent8af17ec762748c4e7cfafdd3a5da8b6cd3b5c863
dm: fix bio splitting and its bio completion order for regular IO

dm_queue_split() is removed because __split_and_process_bio() _must_
handle splitting bios to ensure proper bio submission and completion
ordering as a bio is split.

Otherwise, multiple recursive calls to ->submit_bio will cause multiple
split bios to be allocated from the same ->bio_split mempool at the same
time. This would result in deadlock in low memory conditions because no
progress could be made (only one bio is available in ->bio_split
mempool).

This fix has been verified to still fix the loss of performance, due
to excess splitting, that commit 3c19460f4e9a provided.

Fixes: 3c19460f4e9a ("Revert "dm: always call blk_queue_split() in dm_process_bio()"")
Cc: stable@vger.kernel.org # 5.0+, requires custom backport due to 5.9 changes
Reported-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm.c