diff options
| -rw-r--r-- | block/bfq-iosched.c | 8 | ||||
| -rw-r--r-- | block/blk-mq.c | 2 | ||||
| -rw-r--r-- | include/linux/elevator.h | 1 |
3 files changed, 10 insertions, 1 deletions
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index dfb8cb0af13a..5ba1e0d841b4 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c | |||
| @@ -5396,7 +5396,7 @@ static unsigned int bfq_update_depths(struct bfq_data *bfqd, | |||
| 5396 | return min_shallow; | 5396 | return min_shallow; |
| 5397 | } | 5397 | } |
| 5398 | 5398 | ||
| 5399 | static int bfq_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int index) | 5399 | static void bfq_depth_updated(struct blk_mq_hw_ctx *hctx) |
| 5400 | { | 5400 | { |
| 5401 | struct bfq_data *bfqd = hctx->queue->elevator->elevator_data; | 5401 | struct bfq_data *bfqd = hctx->queue->elevator->elevator_data; |
| 5402 | struct blk_mq_tags *tags = hctx->sched_tags; | 5402 | struct blk_mq_tags *tags = hctx->sched_tags; |
| @@ -5404,6 +5404,11 @@ static int bfq_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int index) | |||
| 5404 | 5404 | ||
| 5405 | min_shallow = bfq_update_depths(bfqd, &tags->bitmap_tags); | 5405 | min_shallow = bfq_update_depths(bfqd, &tags->bitmap_tags); |
| 5406 | sbitmap_queue_min_shallow_depth(&tags->bitmap_tags, min_shallow); | 5406 | sbitmap_queue_min_shallow_depth(&tags->bitmap_tags, min_shallow); |
| 5407 | } | ||
| 5408 | |||
| 5409 | static int bfq_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int index) | ||
| 5410 | { | ||
| 5411 | bfq_depth_updated(hctx); | ||
| 5407 | return 0; | 5412 | return 0; |
| 5408 | } | 5413 | } |
| 5409 | 5414 | ||
| @@ -5826,6 +5831,7 @@ static struct elevator_type iosched_bfq_mq = { | |||
| 5826 | .requests_merged = bfq_requests_merged, | 5831 | .requests_merged = bfq_requests_merged, |
| 5827 | .request_merged = bfq_request_merged, | 5832 | .request_merged = bfq_request_merged, |
| 5828 | .has_work = bfq_has_work, | 5833 | .has_work = bfq_has_work, |
| 5834 | .depth_updated = bfq_depth_updated, | ||
| 5829 | .init_hctx = bfq_init_hctx, | 5835 | .init_hctx = bfq_init_hctx, |
| 5830 | .init_sched = bfq_init_queue, | 5836 | .init_sched = bfq_init_queue, |
| 5831 | .exit_sched = bfq_exit_queue, | 5837 | .exit_sched = bfq_exit_queue, |
diff --git a/block/blk-mq.c b/block/blk-mq.c index 9516304a38ee..fc60ed7e940e 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
| @@ -3135,6 +3135,8 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr) | |||
| 3135 | } | 3135 | } |
| 3136 | if (ret) | 3136 | if (ret) |
| 3137 | break; | 3137 | break; |
| 3138 | if (q->elevator && q->elevator->type->ops.depth_updated) | ||
| 3139 | q->elevator->type->ops.depth_updated(hctx); | ||
| 3138 | } | 3140 | } |
| 3139 | 3141 | ||
| 3140 | if (!ret) | 3142 | if (!ret) |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 2e9e2763bf47..6e8bc53740f0 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
| @@ -31,6 +31,7 @@ struct elevator_mq_ops { | |||
| 31 | void (*exit_sched)(struct elevator_queue *); | 31 | void (*exit_sched)(struct elevator_queue *); |
| 32 | int (*init_hctx)(struct blk_mq_hw_ctx *, unsigned int); | 32 | int (*init_hctx)(struct blk_mq_hw_ctx *, unsigned int); |
| 33 | void (*exit_hctx)(struct blk_mq_hw_ctx *, unsigned int); | 33 | void (*exit_hctx)(struct blk_mq_hw_ctx *, unsigned int); |
| 34 | void (*depth_updated)(struct blk_mq_hw_ctx *); | ||
| 34 | 35 | ||
| 35 | bool (*allow_merge)(struct request_queue *, struct request *, struct bio *); | 36 | bool (*allow_merge)(struct request_queue *, struct request *, struct bio *); |
| 36 | bool (*bio_merge)(struct blk_mq_hw_ctx *, struct bio *); | 37 | bool (*bio_merge)(struct blk_mq_hw_ctx *, struct bio *); |
