Skip to content

loop: improve loop aio perf by IOCB_NOWAIT

Ming Lei linux-block linux-fsdevel 6 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. v5 Latest6 patches 20 repliesApplied
  2. v46 patches 14 repliesSuperseded
  3. v35 patches 4 repliesApplied
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v25 patches6 repliesSuperseded
v1 posting 2/25 patches10 repliesSuperseded
v1 posting 1/25 patches1 replySuperseded

Changes in v5 from the cover letter

- only try nowait in case that backing file supports it (Yu Kuai)
- fix one lockdep assert (syzbot)
- improve comment log (Christoph)

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/6loop: add helper lo_cmd_nr_bvec()drivers/block/loop.c+14 -42 replies
2/6loop: add helper lo_rw_aio_prep()drivers/block/loop.c+40 -230 replies
3/6loop: add lo_submit_rw_aio()drivers/block/loop.c+24 -170 replies
4/6loop: move command blkcg/memcg initialization into loop_queue_workdrivers/block/loop.c+17 -150 replies
5/6loop: try to handle loop aio command via NOWAIT IO firstdrivers/block/loop.c+63 -50 replies
6/6loop: add hint for handling aio via IOCB_NOWAITdrivers/block/loop.c+61 -00 replies

Reviews trailers per patch

2 of 6 patches have a Reviewed-by or Acked-by.

PatchChristoph Hellwig
1/6R-b
2/6
3/6
4/6R-b
5/6
6/6

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

Read the v5 thread

Cover letter [PATCH V5 0/6] loop: improve loop aio perf by IOCB_NOWAIT

Hello Jens,

This patchset improves loop aio perf by using IOCB_NOWAIT for avoiding to queue aio command to workqueue context, meantime refactor lo_rw_aio() a bit.

In my test VM, loop disk perf becomes very close to perf of the backing block device(nvme/mq virtio-scsi).

And Mikulas verified that this way can improve 12jobs sequential readwrite io by ~5X, and basically solve the reported problem together with loop MQ change.

https://lore.kernel.org/linux-block/[email protected]/

Zhaoyang Huang also mentioned it may fix their performance issue on Android use case.

The loop MQ change will be posted as standalone patch, because it needs UAPI change.

V5:
- only try nowait in case that backing file supports it (Yu Kuai)
- fix one lockdep assert (syzbot)
- improve comment log (Christoph)

V4:
- rebase
- re-organize and make it more readable

V3:
- add reviewed-by tag
- rename variable & improve commit log & comment on 5/5(Christoph)

V2:
- patch style fix & cleanup (Christoph)
- fix randwrite perf regression on sparse backing file
- drop MQ change

Ming Lei (6):
loop: add helper lo_cmd_nr_bvec()
loop: add helper lo_rw_aio_prep()
loop: add lo_submit_rw_aio()
loop: move command blkcg/memcg initialization into loop_queue_work
loop: try to handle loop aio command via NOWAIT IO first
loop: add hint for handling aio via IOCB_NOWAIT

 drivers/block/loop.c | 233 +++++++++++++++++++++++++++++++++++--------
 1 file changed, 194 insertions(+), 39 deletions(-)
Signature · 1 line
2.47.0