Skip to content

Commit 5d8d408

Browse files
Hongyu JinMike Snitzer
authored andcommitted
dm crypt: Fix IO priority lost when queuing write bios
Since dm-crypt queues writes to a different kernel thread (workqueue), the bios will dispatch from tasks with different io_context->ioprio settings and blkcg than the submitting task, thus giving incorrect ioprio to the io scheduler. Get the original IO priority setting via struct dm_crypt_io::base_bio and set this priority in the bio for write. Link: https://lore.kernel.org/dm-devel/alpine.LRH.2.11.1612141049250.13402@mail.ewheeler.net Signed-off-by: Hongyu Jin <hongyu.jin@unisoc.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
1 parent d95e2c3 commit 5d8d408

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/md/dm-crypt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,7 @@ static struct bio *crypt_alloc_buffer(struct dm_crypt_io *io, unsigned int size)
16881688
GFP_NOIO, &cc->bs);
16891689
clone->bi_private = io;
16901690
clone->bi_end_io = crypt_endio;
1691+
clone->bi_ioprio = io->base_bio->bi_ioprio;
16911692

16921693
remaining_size = size;
16931694

0 commit comments

Comments
 (0)