summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-05-10 10:56:32 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-16 19:41:17 +0200
commit824c212908b6a6b9bac8fc21cdeec24021f390d0 (patch)
tree6d4b0180653c002afdca6d2683cbdb7d1e47da4c /include/linux
parent3351e9d39947881910230a73be77e6f29ab8b72e (diff)
downloadlinux-stable-824c212908b6a6b9bac8fc21cdeec24021f390d0.tar.gz
linux-stable-824c212908b6a6b9bac8fc21cdeec24021f390d0.tar.bz2
linux-stable-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 'include/linux')
-rw-r--r--include/linux/elevator.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index a02deea30185..a2bf4a6b9316 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -99,6 +99,7 @@ struct elevator_mq_ops {
void (*exit_sched)(struct elevator_queue *);
int (*init_hctx)(struct blk_mq_hw_ctx *, unsigned int);
void (*exit_hctx)(struct blk_mq_hw_ctx *, unsigned int);
+ void (*depth_updated)(struct blk_mq_hw_ctx *);
bool (*allow_merge)(struct request_queue *, struct request *, struct bio *);
bool (*bio_merge)(struct blk_mq_hw_ctx *, struct bio *);