diff options
author | Bart Van Assche <bart.vanassche@sandisk.com> | 2017-04-08 01:50:44 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2017-04-24 21:06:19 +0200 |
commit | 06eb061f48594aa369f6e852b352410298b317a8 (patch) | |
tree | 02c868ed14c9682c49a4f469edad71d730413fd8 /drivers/md/dm-mpath.c | |
parent | dm era: save spacemap metadata root after the pre-commit (diff) | |
download | linux-06eb061f48594aa369f6e852b352410298b317a8.tar.xz linux-06eb061f48594aa369f6e852b352410298b317a8.zip |
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.
Cc: stable@vger.kernel.org # 4.9+
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-mpath.c')
-rw-r--r-- | drivers/md/dm-mpath.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 7f223dbed49f..a4cc4d42117b 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -484,7 +484,6 @@ static int multipath_clone_and_map(struct dm_target *ti, struct request *rq, struct request **__clone) { struct multipath *m = ti->private; - int r = DM_MAPIO_REQUEUE; size_t nr_bytes = blk_rq_bytes(rq); struct pgpath *pgpath; struct block_device *bdev; @@ -503,7 +502,7 @@ static int multipath_clone_and_map(struct dm_target *ti, struct request *rq, } else if (test_bit(MPATHF_QUEUE_IO, &m->flags) || test_bit(MPATHF_PG_INIT_REQUIRED, &m->flags)) { pg_init_all_paths(m); - return r; + return DM_MAPIO_REQUEUE; } memset(mpio, 0, sizeof(*mpio)); @@ -517,7 +516,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; |