mkfs.erofs: should MAX_BLOCK_SIZE be tied to build host page size?
Gao Xiang
hsiangkao at linux.alibaba.com
Wed Feb 25 03:09:07 AEDT 2026
On 2026/2/25 00:02, Matthew Lear wrote:
> Hi Gao Xiang,
>
> Thank you for the quick reply.
>
>>> Is there scope to increase the default block size ceiling of mkfs.erofs
>>> to 16K (or perhaps increase it to 16K for aarch64 compilations)?
>>
>> I think the reasonable maximum block size for EROFS should be no
>> more than 64k.
>>
>> I think we could consider set the MAX_BLOCK_SIZE to 64k for
>> aarch64, but leave it to the page size if `-b` is unspecified.
>>
>> Would you mind submitting a patch for this (checking the target
>> arch, if aarch64, set MAX_BLOCK_SIZE to 64k instead) since I've
>> already had a bunch of other stuffs.
>
> A change in configure.ac to do this looks straight-forward enough (I
> think), but there may be justified concerns about the knock-on effects,
> particularly as MAX_BLOCK_SIZE is used in various arrays. With 16K (4x
> today), these would all increase quite a bit:
>
> lib/liberofs_cache.h: struct list_head watermeter[META +
> 1][2][EROFS_MAX_BLOCK_SIZE];
> lib/namei.c: char buf[EROFS_MAX_BLOCK_SIZE];
> lib/dir.c: char buf[EROFS_MAX_BLOCK_SIZE];
> lib/data.c: u8 buf[EROFS_MAX_BLOCK_SIZE];
> lib/super.c: u8 data[EROFS_MAX_BLOCK_SIZE];
>
> With 64K, the memory footprint would be significantly larger.
> What do you think?
I understand your concern although I think they are just
for temporary use, and 64k is still not too huge and
the userspace stack is less worried.
Or how about just use max(PAGE_SIZE, 16k) instead for
aarch64? then you will get 16k for most of the time
unless PAGE_SIZE > 16k.
Thanks,
Gao Xiang
> -- Matt
More information about the Linux-erofs
mailing list