[PATCH for-6.18/block 00/16] block: fix reordered IO in the case recursive split

Yu Kuai
2025-09-05T07:15:53Z

From: Yu Kuai <yukuai3@huawei.com>

Changes from RFC v3:
- initialize bio->issue_time_ns in blk_mq_submit_bio, patch 2;
- set/clear new queue_flag when iolatency is enabled/disabled, patch 3;
- fix compile problem for md-linear, patch 12;
- make should_fail_bio() non-static, and open code new helper, patch 14;
- remove the checking for zoned disk, patch 15;
Changes from RFC v2:
- add patch 1,2 to cleanup bio_issue;
- add patch 3,4 to fix missing processing for split bio first;
- bypass zoned device in patch 14;
Changes from RFC:
- export a new helper bio_submit_split_bioset() instead of
export bio_submit_split() directly;
- don't set no merge flag in the new helper;
- add patch 7 and patch 10;
- add patch 8 to skip bio checks for resubmitting split bio;

patch 1-5 cleanup bio_issue, and fix missing processing for split bio;
patch 6 export a bio split helper;
patch 7-13 unify bio split code;
path 14,15 convert the helper to insert split bio to the head of current
bio list;
patch 16 is a follow cleanup for raid0;

Yu Kuai (16):
block: cleanup bio_issue
block: initialize bio issue time in blk_mq_submit_bio()
blk-mq: add QUEUE_FLAG_BIO_ISSUE_TIME
md: fix mssing blktrace bio split events
blk-crypto: fix missing blktrace bio split events
block: factor out a helper bio_submit_split_bioset()
md/raid0: convert raid0_handle_discard() to use
bio_submit_split_bioset()
md/raid1: convert to use bio_submit_split_bioset()
md/raid10: add a new r10bio flag R10BIO_Returned
md/raid10: convert read/write to use bio_submit_split_bioset()
md/raid5: convert to use bio_submit_split_bioset()
md/md-linear: convert to use bio_submit_split_bioset()
blk-crypto: convert to use bio_submit_split_bioset()
block: skip unnecessary checks for split bio
block: fix reordered IO in the case recursive split
md/raid0: convert raid0_make_request() to use
bio_submit_split_bioset()

block/bio.c | 2 +-
block/blk-cgroup.h | 6 ----
block/blk-core.c | 19 ++++++-----
block/blk-crypto-fallback.c | 16 ++++------
block/blk-iolatency.c | 19 +++++------
block/blk-merge.c | 64 +++++++++++++++++++++++++------------
block/blk-mq-debugfs.c | 1 +
block/blk-mq.c | 3 ++
block/blk-throttle.c | 2 +-
block/blk.h | 45 ++------------------------
drivers/md/md-linear.c | 14 ++------
drivers/md/raid0.c | 30 ++++++-----------
drivers/md/raid1.c | 38 ++++++++--------------
drivers/md/raid1.h | 4 ++-
drivers/md/raid10.c | 54 ++++++++++++++-----------------
drivers/md/raid10.h | 2 ++
drivers/md/raid5.c | 10 +++---
include/linux/blk_types.h | 7 ++--
include/linux/blkdev.h | 3 ++
19 files changed, 141 insertions(+), 198 deletions(-)

--
2.39.2