mm: use blk_io_schedule() for avoiding task hung in sync io
Subsystems (2)
PATCH 1/1 mm: use blk_io_schedule() for avoiding task hung in sync io
swap_readpage() does the sync io for one page, the io is not big, normally, the io can be finished quickly, but it may take long time or wait forever in case of io failure or discard.
This patch is to use blk_io_schedule() instead of io_schedule() to avoid task hung and crash(when set /proc/sys/kernel/hung_task_panic) in case of above exception occur.
We have prevented task hung in submit_bio_wait(), blk_execute_rq() and __blkdev_direct_IO().
Signed-off-by Xianting Tian <[email protected]>
--- mm/page_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_io.c +1 -1
@@ -424,7 +424,7 @@ int swap_readpage(struct page *page, bool synchronous)break ;if (!blk_poll (disk->queue, qc, true)) -io_schedule (); +blk_io_schedule (); }__set_current_state (TASK_RUNNING );bio_put (bio);
Signature · 1 line
1.8.3.1