Skip to content

null_blk: relaxed memory alignments

Keith Busch linux-block 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest4 patches 23 repliesApplied

Changes in v2 from the cover letter

- A couple cosmetic patches to clean up some of the error handling, as noted by Damien.

- Fixed up the buffer overruns that Hans reported.

- Moved the kmap'ing to a layer lower in the call stack as suggested by Christoph, which also made it easier to fixup relying on virt_to_page. This part of the patch is split out into a prep patch this time.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/4null_blk: simplify copy_from_nullbdrivers/block/null_blk/main.c+3 -44 replies
2/4null_blk: consistently use blk_status_tdrivers/block/null_blk/main.c+7 -74 replies
3/4null_blk: single kmap per bio segmentdrivers/block/null_blk/main.c+14 -184 replies
4/4null_blk: allow byte aligned memory offsetsdrivers/block/null_blk/main.c drivers/block/null_blk/zoned.c+25 -238 replies

Reviews trailers per patch

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

PatchChaitanya KulkarniDamien Le MoalHans HolmbergJohannes ThumshirnChristoph Hellwig
SeriesT-b
1/4R-b R-b R-b R-b
2/4R-b R-b R-b R-b
3/4R-b R-b R-b R-b
4/4R-b R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v2 thread

Cover letter [PATCHv2 0/4] null_blk: relaxed memory alignments

From: Keith Busch <[email protected]>

The direct-io can work with arbitrary memory alignemnts, based on what the block device's queue limits report. This series enhances the null_blk driver by removing the software limitations that required block size memory and length alignment.

Note, funny thing I noticed: this patch could allow null_blk to use byte aligned memory, but the queue limits doesn't have a way to express that. The smallest we can set the mask is 1, meaning 2-byte alignment, because setting the mask to 0 is overridden by the default 511 mask. I'm pretty sure at least some drivers are depending on the default, so can't really change that.

Changes from v1:

- A couple cosmetic patches to clean up some of the error handling, as noted by Damien.

- Fixed up the buffer overruns that Hans reported.

- Moved the kmap'ing to a layer lower in the call stack as suggested by Christoph, which also made it easier to fixup relying on virt_to_page. This part of the patch is split out into a prep patch this time.

Keith Busch (4):
null_blk: simplify copy_from_nullb
null_blk: consistently use blk_status_t
null_blk: single kmap per bio segment
null_blk: allow byte aligned memory offsets

 drivers/block/null_blk/main.c  | 77 ++++++++++++++++------------------
 drivers/block/null_blk/zoned.c |  2 +-
 2 files changed, 38 insertions(+), 41 deletions(-)
Signature · 1 line
2.47.3