]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
block: add blk_io_schedule() for avoiding task hung in sync dio
authorMing Lei <ming.lei@redhat.com>
Sun, 3 May 2020 01:54:22 +0000 (09:54 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 13 May 2020 02:32:42 +0000 (20:32 -0600)
commite6249cdd46e43a7d3bdb8cce5fe24565d6c11e94
treeeb64d5b35a2d76e84afdcea844f39b2709db398c
parent27eb3af9a37a85ca35f82830a8fc29753700058a
block: add blk_io_schedule() for avoiding task hung in sync dio

Sync dio could be big, or may take long time in discard or in case of
IO failure.

We have prevented task hung in submit_bio_wait() and blk_execute_rq(),
so apply the same trick for prevent task hung from happening in sync dio.

Add helper of blk_io_schedule() and use io_schedule_timeout() to prevent
task hung warning.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Cc: Salman Qazi <sqazi@google.com>
Cc: Jesse Barnes <jsbarnes@google.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/block_dev.c
fs/direct-io.c
fs/iomap/direct-io.c
include/linux/blkdev.h