Skip to content

implement async block discards and other ops via io_uring

Pavel Begunkov io-uring linux-block linux-mm 5 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 Latest8 patches 10 repliesApplied
  2. v48 patches 16 repliesApplied
  3. v38 patches 2 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v27 patches12 repliesSuperseded
v1 RFC5 patches20 repliesSuperseded

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/8io_uring/cmd: expose iowq to cmdsinclude/linux/io_uring/cmd.h io_uring/io_uring.c io_uring/io_uring.h +1 more+25 -00 replies
2/8io_uring/cmd: give inline space in request to cmdsinclude/linux/io_uring/cmd.h+9 -00 replies
3/8filemap: introduce filemap_invalidate_pagesinclude/linux/pagemap.h mm/filemap.c+14 -50 replies
4/8block: introduce blk_validate_byte_range()block/ioctl.c+31 -181 reply
5/8block: implement async io_uring discard cmdblock/blk.h block/fops.c block/ioctl.c +1 more+129 -02 replies
6/8block: implement write zeroes io_uring cmdblock/ioctl.c include/uapi/linux/blkdev.h+67 -06 replies
7/8block: add nowait flag for __blkdev_issue_zero_pagesblock/blk-lib.c include/linux/bio.h include/linux/blkdev.h+23 -40 replies
8/8block: implement write zero pages cmdblock/ioctl.c include/uapi/linux/blkdev.h+19 -30 replies

Reviews trailers per patch

1 of 8 patches has a Reviewed-by or Acked-by.

PatchChristoph Hellwig
1/8
2/8
3/8
4/8R-b
5/8
6/8Nacked-by
7/8
8/8

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/8] implement async block discards and other ops via io_uring

There is an interest in having asynchronous block operations like discard and write zeroes. The series implements that as io_uring commands, which is an io_uring request type allowing to implement custom file specific operations.

First 4 are preparation patches. Patch 5 introduces the main chunk of cmd infrastructure and discard commands. Patches 6-8 implement write zeroes variants.

Branch with tests and docs:
https://github.com/isilence/liburing.git discard-cmd

The man page specifically (need to shuffle it to some cmd section):
https://github.com/isilence/liburing/commit/a6fa2bc2400bf7fcb80496e322b5db4c8b3191f0

v5: add uapi/linux/blkdev.h
number block cmd opcodes starting from IOC seq 0
don't export bio_discard_limit(), return to v2 and put bio if nowait
can't proceed
minor comment and stylistics changes

v4: fix failing to pass nowait (unused opf) in patch 7

v3: use GFP_NOWAIT for non-blocking allocation
fail oversized nowait discards in advance drop secure erase and add zero page writes renamed function name + other cosmetic changes use IOC / ioctl encoding for cmd opcodes

v2: move out of CONFIG_COMPAT
add write zeroes & secure erase
drop a note about interaction with page cache

Pavel Begunkov (8):
io_uring/cmd: expose iowq to cmds io_uring/cmd: give inline space in request to cmds
filemap: introduce filemap_invalidate_pages
block: introduce blk_validate_byte_range()
block: implement async io_uring discard cmd
block: implement write zeroes io_uring cmd
block: add nowait flag for __blkdev_issue_zero_pages
block: implement write zero pages cmd

 block/blk-lib.c              |  22 +++-
 block/blk.h                  |   1 +
 block/fops.c                 |   2 +
 block/ioctl.c                | 242 ++++++++++++++++++++++++++++++++---
 include/linux/bio.h          |   4 +
 include/linux/blkdev.h       |   1 +
 include/linux/io_uring/cmd.h |  15 +++
 include/linux/pagemap.h      |   2 +
 include/uapi/linux/blkdev.h  |  16 +++
 io_uring/io_uring.c          |  11 ++
 io_uring/io_uring.h          |   1 +
 io_uring/uring_cmd.c         |   7 +
 mm/filemap.c                 |  17 ++-
 13 files changed, 314 insertions(+), 27 deletions(-)
 create mode 100644 include/uapi/linux/blkdev.h
Signature · 1 line
2.45.2