Re: [PATCH 2/2] ext4: align preallocation size to stripe width
From: Theodore Tso
Date: Thu Apr 09 2026 - 10:37:26 EST
On Mon, Dec 08, 2025 at 04:32:46PM +0800, Yu Kuai wrote:
> When stripe width (io_opt) is configured, align the predicted
> preallocation size to stripe boundaries. This ensures optimal I/O
> performance on RAID and other striped storage devices by avoiding
> partial stripe operations.
>
> The current implementation uses hardcoded size predictions (16KB, 32KB,
> 64KB, etc.) that are not stripe-aware. This causes physical block
> offsets on disk to be misaligned to stripe boundaries, leading to
> read-modify-write penalties on RAID arrays and reduced performance.
>
> This patch makes size prediction stripe-aware by using multiples of
> stripe size (1x, 2x, 4x, 8x, 16x, 32x) when s_stripe is set.
> Additionally, the start offset is aligned to stripe boundaries using
> rounddown(), which works correctly for both power-of-2 and non-power-of-2
> stripe sizes. For devices without stripe configuration, the original
> behavior is preserved.
> ...
Hi Yu,
Did you see the build failures reported by the kernel build bot on the
i386[1] and arm[2] platforms? The problem appears to be using
roundup() and rounddown() on an unsigned long types.
[1] https://lore.kernel.org/r/202512102331.yweFnVTU-lkp@xxxxxxxxx
[2] https://lore.kernel.org/r/202512120613.mM5COVWV-lkp@xxxxxxxxx
We can't apply your patch until this issue is addressed.
Thanks,
- Ted