Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1344361
| From | Ming Lei <ming.lei@canonical.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 0/4] block: fix bio_will_gap() |
| Date | 2016-02-26 16:50 +0100 |
| Message-ID | <r6sOt-5pp-9@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Hi Guys, The bio passed to bio_will_gap() may be fast cloned from upper layer(dm, md, bcache, fs, ...), or from bio splitting in block core. Unfortunately bio_will_gap() just figures out the last bvec via 'bi_io_vec[prev->bi_vcnt - 1]' directly, and this way is obviously wrong in case of fast-cloned bio. It is observed that lots of BIOs are still merged even if the virt boundary limit is violated by the merge, and the issue was reported from Sagi Grimberg. This patch introduces two helpers for getting the first and last bvec of one bio and applys them to fix the issue. Sagi has confirmed the fix. Thanks for Sagi and Christoph's review. V2: - remove unnecessary comment - add reviewed-by V1: - get bvec directly for non-cloned bio - implement bio_get_last_bvec() with single bio_advance_iter(), and avoid to use bio_for_each_segment() which looks a bit inefficient - avoid to double check queue_virt_boundary() in bio_will_gap() block/blk-merge.c | 8 ++------ include/linux/bio.h | 37 +++++++++++++++++++++++++++++++++++++ include/linux/blkdev.h | 23 +++++++++++++++++------ 3 files changed, 56 insertions(+), 12 deletions(-) Thanks, Ming
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH v2 0/4] block: fix bio_will_gap() Ming Lei <ming.lei@canonical.com> - 2016-02-26 16:50 +0100 [PATCH v2 4/4] block: merge: get the 1st and last bvec via helpers Ming Lei <ming.lei@canonical.com> - 2016-02-26 16:50 +0100 [PATCH v2 2/4] block: check virt boundary in bio_will_gap() Ming Lei <ming.lei@canonical.com> - 2016-02-26 16:50 +0100 Re: [PATCH v2 0/4] block: fix bio_will_gap() Sagi Grimberg <sagig@dev.mellanox.co.il> - 2016-02-28 11:00 +0100
csiph-web