diff options
author | Ming Lei <ming.lei@redhat.com> | 2022-06-24 17:12:55 +0300 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2022-07-07 18:49:32 +0300 |
commit | 8b211aaccb915bbf4f4a68f1910c4de701df393b (patch) | |
tree | 7b87a0d117d1b2bb500f7fe6324c163577efe9df /drivers/regulator/sc2731-regulator.c | |
parent | 61cbe7888d0376cd8828b52c5bca56987c6d6cfa (diff) | |
download | linux-8b211aaccb915bbf4f4a68f1910c4de701df393b.tar.xz |
dm: add two stage requeue mechanism
Commit 61b6e2e5321d ("dm: fix BLK_STS_DM_REQUEUE handling when dm_io
represents split bio") reverted DM core's bio splitting back to using
bio_split()+bio_chain() because it was found that otherwise DM's
BLK_STS_DM_REQUEUE would trigger a live-lock waiting for bio
completion that would never occur.
Restore using bio_trim()+bio_inc_remaining(), like was done in commit
7dd76d1feec7 ("dm: improve bio splitting and associated IO
accounting"), but this time with proper handling for the above
scenario that is covered in more detail in the commit header for
61b6e2e5321d.
Solve this issue by adding a two staged dm_io requeue mechanism that
uses the new dm_bio_rewind() via dm_io_rewind():
1) requeue the dm_io into the requeue_list added to struct
mapped_device, and schedule it via new added requeue work. This
workqueue just clones the dm_io->orig_bio (which DM saves and
ensures its end sector isn't modified). dm_io_rewind() uses the
sectors and sectors_offset members of the dm_io that are recorded
relative to the end of orig_bio: dm_bio_rewind()+bio_trim() are
then used to make that cloned bio reflect the subset of the
original bio that is represented by the dm_io that is being
requeued.
2) the 2nd stage requeue is same with original requeue, but
io->orig_bio points to new cloned bio (which matches the requeued
dm_io as described above).
This allows DM core to shift the need for bio cloning from bio-split
time (during IO submission) to the less likely BLK_STS_DM_REQUEUE
handling (after IO completes with that error).
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/regulator/sc2731-regulator.c')
0 files changed, 0 insertions, 0 deletions