summaryrefslogtreecommitdiffstats
path: root/block/blk-mq.c
diff options
context:
space:
mode:
authorJens Axboe2019-05-10 19:56:32 +0200
committerGreg Kroah-Hartman2019-05-16 19:41:17 +0200
commit824c212908b6a6b9bac8fc21cdeec24021f390d0 (patch)
tree6d4b0180653c002afdca6d2683cbdb7d1e47da4c /block/blk-mq.c
parentLinux 4.19.43 (diff)
downloadkernel-qcow2-linux-824c212908b6a6b9bac8fc21cdeec24021f390d0.tar.gz
kernel-qcow2-linux-824c212908b6a6b9bac8fc21cdeec24021f390d0.tar.xz
kernel-qcow2-linux-824c212908b6a6b9bac8fc21cdeec24021f390d0.zip
bfq: update internal depth state when queue depth changes
commit 77f1e0a52d26242b6c2dba019f6ebebfb9ff701e upstream A previous commit moved the shallow depth and BFQ depth map calculations to be done at init time, moving it outside of the hotter IO path. This potentially causes hangs if the users changes the depth of the scheduler map, by writing to the 'nr_requests' sysfs file for that device. Add a blk-mq-sched hook that allows blk-mq to inform the scheduler if the depth changes, so that the scheduler can update its internal state. Signed-off-by: Eric Wheeler <bfq@linux.ewheeler.net> Tested-by: Kai Krakow <kai@kaishome.de> Reported-by: Paolo Valente <paolo.valente@linaro.org> Fixes: f0635b8a416e ("bfq: calculate shallow depths at init time") Signed-off-by: Jens Axboe <axboe@kernel.dk> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r--block/blk-mq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 414656796ecf..4e563ee462cb 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2887,6 +2887,8 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr)
}
if (ret)
break;
+ if (q->elevator && q->elevator->type->ops.mq.depth_updated)
+ q->elevator->type->ops.mq.depth_updated(hctx);
}
if (!ret)