Skip to content

block: Discard merging fixes

Keith Busch linux-block linux-nvme 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 3 repliesIn review
  2. v11 patch 0 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2block: Merge discard requests as a special caseblock/blk-merge.c+28 -11 reply
2/2block: Handle merging discards in IO schedulersblock/bfq-iosched.c block/blk-core.c block/blk-mq-sched.c +4 more+13 -52 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCHv2 0/2] block: Discard merging fixes

This series fixes some incorrect accounting from merging discard requests.

The first patch fixes merging two discard requests by having a special case for merging these using the unique constraints discards have.

The second fixes merging a new discard bio into an existing request. Previously all the schedulers defaulted to a front merge, so the patch just checks merge type and adds a 'case' for handling discard in each of the callers.

I've only been able to test with mq-deadline on NVMe as that is the only driver currently supporting multiple discard ranges in a single command.

v1 -> v2:

Fixed patch 1 based on feedback from Jens, tested with recreate sequence.

Added 2nd patch for merging discard bios into existing requests.

Keith Busch (2):
block: Merge discard requests as a special case
block: Handle merging discards in IO schedulers

 block/bfq-iosched.c      |  2 +-
 block/blk-core.c         |  4 ++++
 block/blk-merge.c        | 29 ++++++++++++++++++++++++++++-
 block/blk-mq-sched.c     |  2 ++
 block/cfq-iosched.c      |  2 +-
 block/deadline-iosched.c |  4 +++-
 block/elevator.c         |  2 +-
 block/mq-deadline.c      |  2 +-
 8 files changed, 41 insertions(+), 6 deletions(-)
Signature · 1 line
2.14.3