aboutsummaryrefslogtreecommitdiffstats
path: root/fs/direct-io.c
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2020-05-03 09:54:22 +0800
committerJens Axboe <axboe@kernel.dk>2020-05-12 20:32:42 -0600
commite6249cdd46e43a7d3bdb8cce5fe24565d6c11e94 (patch)
treeeb64d5b35a2d76e84afdcea844f39b2709db398c /fs/direct-io.c
parentblock: don't hold part0's refcount in IO path (diff)
downloadlinux-dev-e6249cdd46e43a7d3bdb8cce5fe24565d6c11e94.tar.xz
linux-dev-e6249cdd46e43a7d3bdb8cce5fe24565d6c11e94.zip
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>
Diffstat (limited to 'fs/direct-io.c')
-rw-r--r--fs/direct-io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/direct-io.c b/fs/direct-io.c
index 00b4d15bb811..6d5370eac2a8 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -500,7 +500,7 @@ static struct bio *dio_await_one(struct dio *dio)
spin_unlock_irqrestore(&dio->bio_lock, flags);
if (!(dio->iocb->ki_flags & IOCB_HIPRI) ||
!blk_poll(dio->bio_disk->queue, dio->bio_cookie, true))
- io_schedule();
+ blk_io_schedule();
/* wake up sets us TASK_RUNNING */
spin_lock_irqsave(&dio->bio_lock, flags);
dio->waiter = NULL;