Skip to content

RFC block/storage: Prepare for boot-time page size selection on arm64

Eric Curtin cgroups dm-devel drbd-dev linux-arm-kernel linux-bcache linux-block linux-fsdevel linux-ide linux-mm linux-mmc linux-mtd linux-nvme linux-raid linux-scsi lkml nvdimm v9fs virtualization xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 RFC Latest13 patches 2 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13scsi: core: Add dma_boundary_page for page-size DMA boundariesdrivers/scsi/aha152x.c drivers/scsi/cxgbi/cxgb3i/cxgb3i.c drivers/scsi/cxgbi/cxgb4i/cxgb4i.c +16 more+40 -240 replies
2/13mtd: mtdswap: Initialise mtdswap_ops with a page size variabledrivers/mtd/mtdswap.c+2 -21 reply
3/13mmc: mmc_test: Allocate the scratch buffer with the test bufferdrivers/mmc/core/mmc_test.c+4 -30 replies
4/13md: Remove compile-time PAGE_SIZE use in md, dm and bcachedrivers/md/bcache/debug.c drivers/md/dm-switch.c drivers/md/dm-vdo/data-vio.c +6 more+26 -280 replies
5/13zram: Remove PAGE_SIZE use in preprocessor conditionalsdrivers/block/zram/zram_drv.c drivers/block/zram/zram_drv.h+7 -150 replies
6/13xen/blkback: Size indirect_pages for the largest page sizedrivers/block/xen-blkback/common.h drivers/block/xen-blkback/xenbus.c+7 -20 replies
7/13null_blk: Size the nullb_page bitmap for PAGE_SIZE_MAXdrivers/block/null_blk/main.c+2 -10 replies
8/13drbd: Use PAGE_SHIFT_MIN in preprocessor checksdrivers/block/drbd/drbd_actlog.c drivers/block/drbd/drbd_bitmap.c drivers/block/drbd/drbd_int.h+2 -60 replies
9/13nvme: Check the DSM range buffer against PAGE_SIZE_MINdrivers/nvme/host/core.c+1 -10 replies
10/13dm: Initialise swap_bios from the runtime PAGE_SIZEdrivers/md/dm.c+1 -10 replies
11/13virtio: Handle boot-time PAGE_SIZE in balloon, blk and 9p transportdrivers/block/virtio_blk.c drivers/virtio/virtio_balloon.c net/9p/trans_virtio.c+9 -70 replies
12/13ata: sata_sil24: Use flexible arrays for the command block SGEsdrivers/ata/sata_sil24.c+43 -271 reply
13/13mm: Use PAGE_SIZE_MIN/MAX where a compile-time constant is requireddrivers/mtd/mtdswap.c drivers/nvdimm/namespace_devs.c include/linux/leafops.h +15 more+59 -360 replies

Reviews trailers per patch

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

PatchMiquel Raynal
1/13
2/13A-b
3/13
4/13
5/13
6/13
7/13
8/13
9/13
10/13
11/13
12/13
13/13

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

Read the v2 thread

Cover letter [RFC PATCH v2 00/13] block/storage: Prepare for boot-time page size selection on arm64

From: Eric Curtin <[email protected]>

This series is part of the boot-time page size selection work for arm64, posted as RFC [1]. With CONFIG_ARM64_BOOT_TIME_PAGE_SIZE=y, PAGE_SIZE, PAGE_SHIFT and PAGE_MASK are variables chosen at boot with arm64.pagesize=, so code that needs a compile-time constant (array sizes, struct layouts, static initialisers, BUILD_BUG_ON(), case labels, #if) has to use the new PAGE_SIZE_MIN/PAGE_SIZE_MAX limits or a run-time value instead. For fixed page sizes both limits equal PAGE_SIZE, so behaviour should not change.

The patches here convert block, MD, NVMe, SCSI, ATA, MTD and MMC code. They apply on top of the core series [1], whose patch 1 adds PAGE_SIZE_MIN/MAX, and are otherwise independent
of each other. Patches authored by Ryan Roberts come from his v1 [2],
updated for v7.4-rc5. The full tree is at:
https://github.com/ericcurtin/linux/tree/boot-time-page-size-v2

Testing: allmodconfig with the option enabled builds cleanly on arm64 with all of these applied, and the defconfig kernel boots to userspace with 4K, 16K and 64K pages under QEMU/KVM (details in [1]). The code in this series is not otherwise exercised on hardware.

Tool use: these conversions were prepared with an LLM coding assistant (opencode with Claude Sonnet), driven by build errors and followed by an automated review pass. I have not hand-audited every patch, so please review with that in mind and tell me where you would prefer a different approach for your subsystem.

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/

Eric Curtin (8):
scsi: core: Add dma_boundary_page for page-size DMA boundaries
mtd: mtdswap: Initialise mtdswap_ops with a page size variable
mmc: mmc_test: Allocate the scratch buffer with the test buffer
md: Remove compile-time PAGE_SIZE use in md, dm and bcache
zram: Remove PAGE_SIZE use in preprocessor conditionals xen/blkback: Size indirect_pages for the largest page size
null_blk: Size the nullb_page bitmap for PAGE_SIZE_MAX
drbd: Use PAGE_SHIFT_MIN in preprocessor checks

Ryan Roberts (5):
nvme: Check the DSM range buffer against PAGE_SIZE_MIN
dm: Initialise swap_bios from the runtime PAGE_SIZE
virtio: Handle boot-time PAGE_SIZE in balloon, blk and 9p transport
ata: sata_sil24: Use flexible arrays for the command block SGEs
mm: Use PAGE_SIZE_MIN/MAX where a compile-time constant is required