Re: [PATCH v4] ext4: simplify mballoc preallocation size rounding for small files
From: Theodore Ts'o
Date: Fri Apr 10 2026 - 11:26:56 EST
On Wed, 25 Feb 2026 13:02:31 +0800, Weixie Cui wrote:
> The if-else ladder in ext4_mb_normalize_request() manually rounds up
> the preallocation size to the next power of two for files up to 1MB,
> enumerating each step from 16KB to 1MB individually. Replace this with
> a single roundup_pow_of_two() call clamped to a 16KB minimum, which
> is functionally equivalent but much more concise.
>
> Also replace raw byte constants with SZ_1M and SZ_16K from
> <linux/sizes.h> for clarity, and remove the stale "XXX: should this
> table be tunable?" comment that has been there since the original
> mballoc code.
>
> [...]
Applied, thanks!
[1/1] ext4: simplify mballoc preallocation size rounding for small files
commit: af1502f98e2cdd43504596cd438f3aa6d0be8712
Best regards,
--
Theodore Ts'o <tytso@xxxxxxx>