diff options
author | Bart Van Assche <bvanassche@acm.org> | 2019-07-01 11:47:29 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-07-02 23:03:27 -0400 |
commit | c05f42206f4de12b6807270fc669b45472f1bdb7 (patch) | |
tree | 82aaf5161958336f8ef635f9f7a8daaeddad7f64 /block/blk-mq-sched.c | |
parent | 417232880c8a646739dbf4666a231505a1917fcb (diff) |
blk-mq: remove blk_mq_put_ctx()
No code that occurs between blk_mq_get_ctx() and blk_mq_put_ctx() depends
on preemption being disabled for its correctness. Since removing the CPU
preemption calls does not measurably affect performance, simplify the
blk-mq code by removing the blk_mq_put_ctx() function and also by not
disabling preemption in blk_mq_get_ctx().
Cc: Hannes Reinecke <hare@suse.com>
Cc: Omar Sandoval <osandov@fb.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq-sched.c')
-rw-r--r-- | block/blk-mq-sched.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index 956a7aa9a637..c9d183d6c499 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c | |||
@@ -330,10 +330,8 @@ bool __blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio, | |||
330 | bool ret = false; | 330 | bool ret = false; |
331 | enum hctx_type type; | 331 | enum hctx_type type; |
332 | 332 | ||
333 | if (e && e->type->ops.bio_merge) { | 333 | if (e && e->type->ops.bio_merge) |
334 | blk_mq_put_ctx(ctx); | ||
335 | return e->type->ops.bio_merge(hctx, bio, nr_segs); | 334 | return e->type->ops.bio_merge(hctx, bio, nr_segs); |
336 | } | ||
337 | 335 | ||
338 | type = hctx->type; | 336 | type = hctx->type; |
339 | if ((hctx->flags & BLK_MQ_F_SHOULD_MERGE) && | 337 | if ((hctx->flags & BLK_MQ_F_SHOULD_MERGE) && |
@@ -344,7 +342,6 @@ bool __blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio, | |||
344 | spin_unlock(&ctx->lock); | 342 | spin_unlock(&ctx->lock); |
345 | } | 343 | } |
346 | 344 | ||
347 | blk_mq_put_ctx(ctx); | ||
348 | return ret; | 345 | return ret; |
349 | } | 346 | } |
350 | 347 | ||