Skip to content

RFC fs: Prepare for boot-time page size selection on arm64

Eric Curtin ceph-devel ecryptfs fuse-devel gfs2 linux-arm-kernel linux-btrfs linux-cifs linux-erofs linux-ext4 linux-fsdevel linux-mm linux-nfs linux-nilfs lkml ntfs ntfs3 ocfs2-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 RFC Latest22 patches 1 replyIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/22smb: client: Use PAGE_SIZE_MIN in the lock element build checksfs/smb/client/file.c fs/smb/client/smb2file.c+4 -40 replies
2/22fs/resctrl: Define the kernfs_ops as page-size variablesfs/resctrl/rdtgroup.c+5 -40 replies
3/22ocfs2: Use PAGE_SIZE_MIN/MAX for the page-count limitsfs/ocfs2/aops.c fs/ocfs2/dlm/dlmcommon.h+6 -80 replies
4/22ntfs3: Use MAX_BUF_PER_PAGE_SIZE_MAX for struct ntfs_buffersfs/ntfs3/ntfs_fs.h+1 -10 replies
5/22ntfs: Use PAGE_SIZE_MIN in NTFS_WOF_MAX_PAGESfs/ntfs/wof.c+1 -10 replies
6/22nilfs2: Test PAGE_SIZE at run time in the rec_len conversionsfs/nilfs2/dir.c+6 -80 replies
7/22jfs: Use PAGE_SIZE_MAX to size the metapage anchor arraysfs/jfs/jfs_metapage.c+4 -30 replies
8/22isofs: Use PAGE_SIZE_MAX for zisofs_sink_pagefs/isofs/compress.c+1 -10 replies
9/22ext4: Use PAGE_SIZE_MAX for the inline KUnit test data bufferfs/ext4/inline-test.c+1 -10 replies
10/22ext2: Test PAGE_SIZE at run time in the rec_len conversionsfs/ext2/dir.c+7 -90 replies
11/22erofs: Make the decompressor bounce buffers flexible arraysfs/erofs/decompressor_deflate.c fs/erofs/decompressor_lzma.c fs/erofs/decompressor_zstd.c +1 more+7 -70 replies
12/22ecryptfs: Resolve the PAGE_SIZE cache sizes at cache creation timefs/ecryptfs/main.c+2 -40 replies
13/22dlm: Use PAGE_SIZE_MIN in the lowcomms buffer size build checkfs/dlm/lowcomms.c+1 -10 replies
14/22cramfs: Allocate the read buffers at init timefs/cramfs/inode.c+38 -30 replies
15/22ceph: Use PAGE_SHIFT_MIN in the ceph_fscrypt_blocks() build checkfs/ceph/crypto.h+1 -10 replies
16/22btrfs: Use PAGE_SIZE_MAX in a static_assert and min_t() for PAGE_SHIFTfs/btrfs/fs.h fs/btrfs/raid56.c+2 -20 replies
17/22afs: Use PAGE_SIZE_MAX to size struct afs_xdr_dir_pagefs/afs/xdr_fs.h+2 -10 replies
18/22fuse: Check CUSE and ioctl buffer sizes against PAGE_SIZE_MINfs/fuse/cuse.c fs/fuse/ioctl.c+3 -20 replies
19/22btrfs: Use PAGE_SIZE_MAX and PAGE_SIZE_MIN for compile-time checksfs/btrfs/compression.h fs/btrfs/defrag.c fs/btrfs/extent_io.h +1 more+5 -51 reply
20/22NFSv4: Use PAGE_SIZE_MIN to size ACL and xattr page arraysfs/nfs/nfs42proc.c fs/nfs/nfs42xattr.c fs/nfs/nfs4proc.c+3 -30 replies
21/22coredump: Use PAGE_SIZE_MIN for the zero-fill bufferfs/binfmt_elf.c fs/coredump.c+6 -90 replies
22/22fat: Use MAX_BUF_PER_PAGE_SIZE_MAX to size buffer_head arraysfs/fat/dir.c fs/fat/fatent.c include/linux/buffer_head.h+5 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC PATCH v2 00/22] fs: 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 filesystems. 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 (17):
smb: client: Use PAGE_SIZE_MIN in the lock element build checks fs/resctrl: Define the kernfs_ops as page-size variables
ocfs2: Use PAGE_SIZE_MIN/MAX for the page-count limits
ntfs3: Use MAX_BUF_PER_PAGE_SIZE_MAX for struct ntfs_buffers
ntfs: Use PAGE_SIZE_MIN in NTFS_WOF_MAX_PAGES
nilfs2: Test PAGE_SIZE at run time in the rec_len conversions
jfs: Use PAGE_SIZE_MAX to size the metapage anchor arrays
isofs: Use PAGE_SIZE_MAX for zisofs_sink_page
ext4: Use PAGE_SIZE_MAX for the inline KUnit test data buffer
ext2: Test PAGE_SIZE at run time in the rec_len conversions
erofs: Make the decompressor bounce buffers flexible arrays
ecryptfs: Resolve the PAGE_SIZE cache sizes at cache creation time
dlm: Use PAGE_SIZE_MIN in the lowcomms buffer size build check
cramfs: Allocate the read buffers at init time
ceph: Use PAGE_SHIFT_MIN in the ceph_fscrypt_blocks() build check
btrfs: Use PAGE_SIZE_MAX in a static_assert and min_t() for PAGE_SHIFT
afs: Use PAGE_SIZE_MAX to size struct afs_xdr_dir_page

Ryan Roberts (5):
fuse: Check CUSE and ioctl buffer sizes against PAGE_SIZE_MIN
btrfs: Use PAGE_SIZE_MAX and PAGE_SIZE_MIN for compile-time checks
NFSv4: Use PAGE_SIZE_MIN to size ACL and xattr page arrays
coredump: Use PAGE_SIZE_MIN for the zero-fill buffer
fat: Use MAX_BUF_PER_PAGE_SIZE_MAX to size buffer_head arrays