dm-mpath: Requeue after a small delay if blk_get_request() fails
PATCH 1/1 dm-mpath: Requeue after a small delay if blk_get_request() fails
If blk_get_request() returns ENODEV then multipath_clone_and_map() causes a request to be requeued immediately. This can cause a kworker thread to spend 100% of the CPU time of a single core in __blk_mq_run_hw_queue() and also can cause device removal to never finish.
Avoid this by only requeuing after a delay if blk_get_request() fails. Additionally, reduce the requeue delay.
--- drivers/md/dm-mpath.c | 2 +- drivers/md/dm-rq.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/md/dm-mpath.c +1 -1
@@ -517,7 +517,7 @@ static int multipath_clone_and_map(struct dm_target *ti, struct request *rq, GFP_ATOMIC);if (IS_ERR (clone)) {/* EBUSY, ENODEV or EWOULDBLOCK: requeue */ -return r; +return DM_MAPIO_DELAY_REQUEUE ; } clone->bio = clone->biotail =NULL ; clone->rq_disk = bdev->bd_disk;
drivers/md/dm-rq.c +1 -1
@@ -280,7 +280,7 @@ static void dm_requeue_original_request(struct dm_rq_target_io *tio, bool delay_if (!rq->q->mq_ops)dm_old_requeue_request (rq);else -dm_mq_delay_requeue_request (rq, delay_requeue ?5000 :0 ); +dm_mq_delay_requeue_request (rq, delay_requeue ?100 /*ms*/ :0 );rq_completed (md, rw, false); }
Signature · 1 line
2.12.0
Quoted 8 lines · Bart Van Assche
If
blk_get_request()returns ENODEV thenmultipath_clone_and_map()causes a request to be requeued immediately. This can cause a kworker thread to spend 100% of the CPU time of a single core in__blk_mq_run_hw_queue()and also can cause device removal to never finish.Avoid this by only requeuing after a delay if
blk_get_request()fails. Additionally, reduce the requeue delay.
Hello Mike,
The v4.12 merge window will open soon. Have you already had the time to review this patch?
Thanks,
Bart.