Re: allow file systems to increase the minimum writeback chunk size v2

Christoph Hellwig
2025-10-22T05:34:41Z

Looks like everything is reviewed now, can we get this queued up
as it fixes nasty fragmentation for zoned XFS?

It seems like the most recent writeback updates went through the VFS
tree, although -mm has been quite common as well.

On Fri, Oct 17, 2025 at 05:45:46AM +0200, Christoph Hellwig wrote:
> Hi all,
>
> The relatively low minimal writeback size of 4MiB leads means that
> written back inodes on rotational media are switched a lot. Besides
> introducing additional seeks, this also can lead to extreme file
> fragmentation on zoned devices when a lot of files are cached relative
> to the available writeback bandwidth.
>
> Add a superblock field that allows the file system to override the
> default size, and set it to the zone size for zoned XFS.
>
> Changes since v1:
> - covert the field to a long to match other related writeback code
> - cap the zone XFS writeback size to the maximum extent size
> - write an extensive comment about the tradeoffs of setting the value
> - fix a commit message typo
>
> Diffstat:
> fs/fs-writeback.c | 26 +++++++++-----------------
> fs/super.c | 1 +
> fs/xfs/xfs_zone_alloc.c | 28 ++++++++++++++++++++++++++--
> include/linux/fs.h | 1 +
> include/linux/writeback.h | 5 +++++
> 5 files changed, 42 insertions(+), 19 deletions(-)
---end quoted text---