Skip to content

blk-mq: optimize flush and request size

[email protected] linux-block lkml 4 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 13 repliesApplied
  2. v34 patches 3 repliesSuperseded
  3. v24 patches 9 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches8 repliesSuperseded

Changes in v4 from the cover letter

- Rebase on the updated block/master branch, which include a flush bugfix from Christoph. Please help to check patch 04. Thanks!
- Add a bugfix patch 02 for post-flush requests, put before other flush optimizations.
- Collect Reviewed-by tags from Ming and Christoph. Thanks!
- [v3] https://lore.kernel.org/lkml/[email protected]/

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/4blk-mq: use percpu csd to remote complete instead of per-rq csdblock/blk-mq.c include/linux/blk-mq.h+7 -100 replies
2/4blk-flush: fix rq->flush.seq for post-flush requestsblock/blk-flush.c+1 -10 replies
3/4blk-flush: count inflight flush_data requestsblock/blk-flush.c block/blk.h+7 -70 replies
4/4blk-flush: reuse rq queuelist in flush state machineblock/blk-flush.c include/linux/blk-mq.h+10 -812 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchMing LeiChristoph Hellwig
1/4R-b R-b
2/4R-b
3/4R-b R-b
4/4R-b R-b

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

Read the v4 thread

Cover letter [PATCH v4 0/4] blk-mq: optimize flush and request size

From: Chengming Zhou <[email protected]>

v4:
- Rebase on the updated block/master branch, which include a flush bugfix from Christoph. Please help to check patch 04. Thanks!
- Add a bugfix patch 02 for post-flush requests, put before other flush optimizations.
- Collect Reviewed-by tags from Ming and Christoph. Thanks!
- [v3] https://lore.kernel.org/lkml/[email protected]/

v3:
- Collect Reviewed-by tags from Ming and Christoph. Thanks!
- Remove the list and csd variables which are only used once.
- Fix a bug report of blktests nvme/012 by re-initialization of rq->queuelist, which maybe corrupted by rq->rq_next reuse.
- [v2] https://lore.kernel.org/all/[email protected]/

v2:
- Change to use call_single_data_t, which use __aligned() to avoid
to use 2 cache lines for 1 csd. Thanks Ming Lei.
- [v1] https://lore.kernel.org/all/[email protected]/

Hello,

After the commit be4c427809b0 ("blk-mq: use the I/O scheduler for writes from the flush state machine"), rq->flush can't reuse rq->elv anymore, since flush_data requests can go into io scheduler now.

That increased the size of struct request by 24 bytes, but this patchset can decrease the size by 40 bytes, which is good I think.

patch 1 use percpu csd to do remote complete instead of per-rq csd, decrease the size by 24 bytes.

patch 2 fixes a bug in blk-flush for post-flush requests.

patch 3-4 reuse rq->queuelist in flush state machine pending list, and maintain unsigned long counter of inflight flush_data requests, decrease the size by 16 bytes.

Thanks for comments!

Chengming Zhou (4):
blk-mq: use percpu csd to remote complete instead of per-rq csd
blk-flush: fix rq->flush.seq for post-flush requests
blk-flush: count inflight flush_data requests
blk-flush: reuse rq queuelist in flush state machine

 block/blk-flush.c      | 26 +++++++++++++++-----------
 block/blk-mq.c         | 12 ++++++------
 block/blk.h            |  5 ++---
 include/linux/blk-mq.h |  6 +-----
 4 files changed, 24 insertions(+), 25 deletions(-)
Signature · 1 line
2.41.0