diff options
author | Ming Lei <ming.lei@canonical.com> | 2015-10-20 17:13:55 +0200 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-10-21 23:00:54 +0200 |
commit | 7460d389c01741f0dfff733af93d3b3abd9b974e (patch) | |
tree | ec3904b3fab8e38bb5b2c583cdde993ef2d7f451 /block | |
parent | blk-mq: check bio_mergeable() early before merging (diff) | |
download | linux-7460d389c01741f0dfff733af93d3b3abd9b974e.tar.xz linux-7460d389c01741f0dfff733af93d3b3abd9b974e.zip |
block: check bio_mergeable() early before merging
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>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/elevator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/elevator.c b/block/elevator.c index 84d63943f2de..c3555c9c672f 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; /* |