Skip to content

block: fix mismatch of figuring out physical segment number

Ming Lei linux-block 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3block: don't use bio->bi_vcnt to figure out segment numberblock/blk-merge.c+1 -71 reply
2/3block: kill QUEUE_FLAG_NO_SG_MERGEblock/blk-merge.c block/blk-mq-debugfs.c block/blk-mq.c +2 more+6 -432 replies
3/3block: kill BLK_MQ_F_SG_MERGEblock/blk-mq-debugfs.c drivers/block/loop.c drivers/block/nbd.c +7 more+7 -110 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMike SnitzerChristoph Hellwig
SeriesA-b
1/3R-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] block: fix mismatch of figuring out physical segment number

Hi,

This patchset fixes one issue related with physical segment computation, which is found by Mike. In case of dm-rq, the warning of 'blk_cloned_rq_check_limits:
over max segments limit' can be triggered easily.

Follows the cause:

1) in IO fast path(blk_queue_split()), we always figure out physical segment number no matter the flag of QUEUE_FLAG_NO_SG_MERGE is set or not.

2) only blk_recount_segments() and blk_recalc_rq_segments() uses the flag of QUEUE_FLAG_NO_SG_MERGE, but the two are only called in some unusual cases, such as request clone in dm-rq.

3) the above two computation don't match, and cause the warning of "blk_cloned_rq_check_limits: over max segments limit".

This patchset fixes this issue by killing the queue flag since it is basically bypassed since v4.4, and no one complains that at all. Also multipage bvec will come soon, and it doesn't make sense to keep QUEUE_FLAG_NO_SG_MERGE any more.

Ming Lei (3):
block: don't use bio->bi_vcnt to figure out segment number
block: kill QUEUE_FLAG_NO_SG_MERGE
block: kill BLK_MQ_F_SG_MERGE

 block/blk-merge.c            | 39 +++++++--------------------------------
 block/blk-mq-debugfs.c       |  2 --
 block/blk-mq.c               |  3 ---
 drivers/block/loop.c         |  2 +-
 drivers/block/nbd.c          |  2 +-
 drivers/block/rbd.c          |  2 +-
 drivers/block/skd_main.c     |  1 -
 drivers/block/xen-blkfront.c |  2 +-
 drivers/md/dm-rq.c           |  2 +-
 drivers/md/dm-table.c        | 13 -------------
 drivers/mmc/core/queue.c     |  3 +--
 drivers/scsi/scsi_lib.c      |  2 +-
 include/linux/blk-mq.h       |  1 -
 include/linux/blkdev.h       |  1 -
 14 files changed, 14 insertions(+), 61 deletions(-)
Cc Christoph Hellwig <[email protected]>
Cc Mike Snitzer <[email protected]>
Cc Kent Overstreet <[email protected]>
Signature · 1 line
2.9.5