Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1251793

[PATCH v2 5/7] block: check bio_mergeable() early before merging

From Ming Lei <ming.lei@canonical.com>
Newsgroups linux.kernel
Subject [PATCH v2 5/7] block: check bio_mergeable() early before merging
Date 2015-10-20 17:20 +0200
Message-ID <qlGRI-7xO-31@gated-at.bofh.it> (permalink)
References <qlGRI-7xO-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


After bio splitting is introduced, one bio can be splitted
and it is marked as NOMERGE because it is too fat to be merged,
so check bio_mergeable() earlier to avoid to try to merge it
unnecessarily.

Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
 block/elevator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/elevator.c b/block/elevator.c
index 84d6394..c3555c9 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -420,7 +420,7 @@ int elv_merge(struct request_queue *q, struct request **req, struct bio *bio)
 	 * 	noxmerges: Only simple one-hit cache try
 	 * 	merges:	   All merge tries attempted
 	 */
-	if (blk_queue_nomerges(q))
+	if (blk_queue_nomerges(q) || !bio_mergeable(bio))
 		return ELEVATOR_NO_MERGE;
 
 	/*
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/7] block: some misc changes Ming Lei <ming.lei@canonical.com> - 2015-10-20 17:20 +0200
  [PATCH v2 2/7] block: setup bi_phys_segments after splitting Ming Lei <ming.lei@canonical.com> - 2015-10-20 17:20 +0200
  [PATCH v2 5/7] block: check bio_mergeable() early before merging Ming Lei <ming.lei@canonical.com> - 2015-10-20 17:20 +0200
    Re: [PATCH v2 5/7] block: check bio_mergeable() early before merging Jeff Moyer <jmoyer@redhat.com> - 2015-10-20 17:30 +0200
  [PATCH v2 7/7] blk-mq: mark ctx as pending at batch in flush plug path Ming Lei <ming.lei@canonical.com> - 2015-10-20 17:20 +0200
  [PATCH v2 6/7] blk-mq: fix for trace_block_plug() Ming Lei <ming.lei@canonical.com> - 2015-10-20 17:20 +0200
    Re: [PATCH v2 6/7] blk-mq: fix for trace_block_plug() Jeff Moyer <jmoyer@redhat.com> - 2015-10-20 17:30 +0200
  [PATCH v2 1/7] block: fix plug list flushing for nomerge queues Ming Lei <ming.lei@canonical.com> - 2015-10-20 17:20 +0200
  [PATCH v2 4/7] blk-mq: check bio_mergeable() early before merging Ming Lei <ming.lei@canonical.com> - 2015-10-20 17:20 +0200
  Re: [PATCH v2 0/7] block: some misc changes Jens Axboe <axboe@kernel.dk> - 2015-10-21 23:10 +0200

csiph-web