* [PATCH] blk-mq: remove unused function hctx_allow_merges
@ 2017-09-30 7:01 weiping zhang
2017-09-30 7:53 ` Ming Lei
2017-09-30 8:15 ` Jens Axboe
0 siblings, 2 replies; 4+ messages in thread
From: weiping zhang @ 2017-09-30 7:01 UTC (permalink / raw)
To: axboe; +Cc: linux-block
since 9bddeb2a5b981 "blk-mq: make per-sw-queue bio merge as default .bio_merge"
there is no caller for this function.
Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
---
block/blk-mq.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index f84d145..520d257 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1484,12 +1484,6 @@ static void blk_mq_bio_to_request(struct request *rq, struct bio *bio)
blk_account_io_start(rq, true);
}
-static inline bool hctx_allow_merges(struct blk_mq_hw_ctx *hctx)
-{
- return (hctx->flags & BLK_MQ_F_SHOULD_MERGE) &&
- !blk_queue_nomerges(hctx->queue);
-}
-
static inline void blk_mq_queue_io(struct blk_mq_hw_ctx *hctx,
struct blk_mq_ctx *ctx,
struct request *rq)
--
2.9.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] blk-mq: remove unused function hctx_allow_merges
2017-09-30 7:01 [PATCH] blk-mq: remove unused function hctx_allow_merges weiping zhang
@ 2017-09-30 7:53 ` Ming Lei
2017-09-30 8:15 ` Jens Axboe
1 sibling, 0 replies; 4+ messages in thread
From: Ming Lei @ 2017-09-30 7:53 UTC (permalink / raw)
To: Jens Axboe, linux-block
On Sat, Sep 30, 2017 at 3:01 PM, weiping zhang
<zhangweiping@didichuxing.com> wrote:
> since 9bddeb2a5b981 "blk-mq: make per-sw-queue bio merge as default .bio_merge"
> there is no caller for this function.
>
> Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
--
Ming Lei
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] blk-mq: remove unused function hctx_allow_merges
2017-09-30 7:01 [PATCH] blk-mq: remove unused function hctx_allow_merges weiping zhang
2017-09-30 7:53 ` Ming Lei
@ 2017-09-30 8:15 ` Jens Axboe
2017-09-30 8:16 ` Jens Axboe
1 sibling, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2017-09-30 8:15 UTC (permalink / raw)
To: weiping zhang; +Cc: linux-block
On 09/30/2017 09:01 AM, weiping zhang wrote:
> since 9bddeb2a5b981 "blk-mq: make per-sw-queue bio merge as default .bio_merge"
> there is no caller for this function.
Looks like this should change the new check to actually use this function
instead, or we will be doing merges if someone has turned off merging
through the sysfs 'nomerges' function.
diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
index 4ab69435708c..5a3fe1bc5de6 100644
--- a/block/blk-mq-sched.c
+++ b/block/blk-mq-sched.c
@@ -224,6 +224,12 @@ static bool blk_mq_attempt_merge(struct request_queue *q,
return false;
}
+static inline bool hctx_allow_merges(struct blk_mq_hw_ctx *hctx)
+{
+ return (hctx->flags & BLK_MQ_F_SHOULD_MERGE) &&
+ !blk_queue_nomerges(hctx->queue);
+}
+
bool __blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio)
{
struct elevator_queue *e = q->elevator;
@@ -236,7 +242,7 @@ bool __blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio)
return e->type->ops.mq.bio_merge(hctx, bio);
}
- if (hctx->flags & BLK_MQ_F_SHOULD_MERGE) {
+ if (hctx_allow_merges(hctx)) {
/* default per sw-queue merge */
spin_lock(&ctx->lock);
ret = blk_mq_attempt_merge(q, ctx, bio);
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 98a18609755e..59687ed6561b 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1504,12 +1504,6 @@ static void blk_mq_bio_to_request(struct request *rq, struct bio *bio)
blk_account_io_start(rq, true);
}
-static inline bool hctx_allow_merges(struct blk_mq_hw_ctx *hctx)
-{
- return (hctx->flags & BLK_MQ_F_SHOULD_MERGE) &&
- !blk_queue_nomerges(hctx->queue);
-}
-
static inline void blk_mq_queue_io(struct blk_mq_hw_ctx *hctx,
struct blk_mq_ctx *ctx,
struct request *rq)
--
Jens Axboe
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] blk-mq: remove unused function hctx_allow_merges
2017-09-30 8:15 ` Jens Axboe
@ 2017-09-30 8:16 ` Jens Axboe
0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2017-09-30 8:16 UTC (permalink / raw)
To: weiping zhang; +Cc: linux-block
On 09/30/2017 10:15 AM, Jens Axboe wrote:
> On 09/30/2017 09:01 AM, weiping zhang wrote:
>> since 9bddeb2a5b981 "blk-mq: make per-sw-queue bio merge as default .bio_merge"
>> there is no caller for this function.
>
> Looks like this should change the new check to actually use this function
> instead, or we will be doing merges if someone has turned off merging
> through the sysfs 'nomerges' function.
Actually, looks like the caller does that now, so the patch was actually
fine.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-09-30 8:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-30 7:01 [PATCH] blk-mq: remove unused function hctx_allow_merges weiping zhang
2017-09-30 7:53 ` Ming Lei
2017-09-30 8:15 ` Jens Axboe
2017-09-30 8:16 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox