[PATCH v1] erofs-utils: mkfs: Implement 'dsunit' alignment on blobdev
Gao Xiang
hsiangkao at linux.alibaba.com
Thu Aug 21 20:03:48 AEST 2025
On 2025/8/21 17:36, Friendy.Su at sony.com wrote:
> Hi, Gao,
>
>> But if there is some deduplciated chunks in the logical dsunit
>> boundary, don't align it at all since there is no real benefit.
>> Although I'm still not sure what's the default behavior of `dsunit`
>> for chunks.
>
> Exactly, if `--chunksize=4096 --dsunit=512`, any 4K deduplicated will cause PMD map failure. Can we consider the following countermeasure as default behavior:
>
> 1. In man page, describe 'chunksize' and 'dsunit' should be collaborated to achieve the best performance.
Agreed, we should mention that in the manpage:
>
> 2. At runtime, if chunksize < dsunit,
> prompt alert message, tell user it is better set chunksize=dsunit. But still format with user set options.
> The benefit is user can still set as desired. Current, for the use cases we can imagine, chunksize=dsunit is best. But maybe users have their own use cases, it is better let users do what they really wanted.
But could we just apply your patch only to the dsunit>=chunksize
case to fulfill your exist use case? I mean we still ignore
`dsunit` if dsunit!=chunksize and warn out users explicitly (
`dsunit` doesn't work due to dsunit!=chunksize).
I really need to think about chunksize != dsunit cases, but
since you don't have such urgent need, let's keep the old `ignore`
behavior for now...
Thanks,
Gao XIang
>
>
> If mkfs.erofs force to align every 2M, even there is only 4K not deduplicated in 2M, the 4K actually still occupies 2M.
> 0, 2M(only 4K data new, others all deduplicated), 4M........
> Space usage efficiency is same as chunksize=dsunit=2M.
>
>
> Best Regards
> Friendy
>
More information about the Linux-erofs
mailing list