diff options
author | Christoph Hellwig <hch@lst.de> | 2019-05-21 09:01:40 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-05-23 18:25:26 +0200 |
commit | eded341c085bebdd653f8086c02179098cb81748 (patch) | |
tree | a454ef941f258d1d0e7ec4c6bd7d5580d9192e51 /block/blk-settings.c | |
parent | sbitmap: fix improper use of smp_mb__before_atomic() (diff) | |
download | linux-eded341c085bebdd653f8086c02179098cb81748.tar.xz linux-eded341c085bebdd653f8086c02179098cb81748.zip |
block: don't decrement nr_phys_segments for physically contigous segments
Currently ll_merge_requests_fn, unlike all other merge functions,
reduces nr_phys_segments by one if the last segment of the previous,
and the first segment of the next segement are contigous. While this
seems like a nice solution to avoid building smaller than possible
requests it causes a mismatch between the segments actually present
in the request and those iterated over by the bvec iterators, including
__rq_for_each_bio. This can for example mistrigger the single segment
optimization in the nvme-pci driver, and might lead to mismatching
nr_phys_segments number when recalculating the number of request
when inserting a cloned request.
We could possibly work around this by making the bvec iterators take
the front and back segment size into account, but that would require
moving them from the bio to the bio_iter and spreading this mess
over all users of bvecs. Or we could simply remove this optimization
under the assumption that most users already build good enough bvecs,
and that the bio merge patch never cared about this optimization
either. The latter is what this patch does.
dff824b2aadb ("nvme-pci: optimize mapping of small single segment requests").
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-settings.c')
0 files changed, 0 insertions, 0 deletions