public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: Do not merge if merging is disabled
@ 2023-07-06 20:14 Bart Van Assche
  2023-07-06 23:43 ` Damien Le Moal
  2023-07-07  0:38 ` Ming Lei
  0 siblings, 2 replies; 6+ messages in thread
From: Bart Van Assche @ 2023-07-06 20:14 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Ming Lei,
	Damien Le Moal

While testing the performance impact of zoned write pipelining, I
noticed that merging happens even if merging has been disabled via
sysfs. Fix this.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 block/blk-mq-sched.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
index 67c95f31b15b..8883721f419a 100644
--- a/block/blk-mq-sched.c
+++ b/block/blk-mq-sched.c
@@ -375,7 +375,8 @@ bool blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio,
 bool blk_mq_sched_try_insert_merge(struct request_queue *q, struct request *rq,
 				   struct list_head *free)
 {
-	return rq_mergeable(rq) && elv_attempt_insert_merge(q, rq, free);
+	return !blk_queue_nomerges(q) && rq_mergeable(rq) &&
+		elv_attempt_insert_merge(q, rq, free);
 }
 EXPORT_SYMBOL_GPL(blk_mq_sched_try_insert_merge);
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-07 13:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-06 20:14 [PATCH] block: Do not merge if merging is disabled Bart Van Assche
2023-07-06 23:43 ` Damien Le Moal
2023-07-07  0:38 ` Ming Lei
2023-07-07  1:50   ` Bart Van Assche
2023-07-07  3:34     ` Damien Le Moal
2023-07-07 13:50       ` Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox