Re: [PATCH 2/3] writeback: allow the file system to override MIN_WRITEBACK_PAGES

Theodore Ts'o
2025-10-15T15:14:31Z

On Wed, Oct 15, 2025 at 03:27:15PM +0900, Christoph Hellwig wrote:
> 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.

I wonder if we should bump the default; and if the concern is that
might be problematic for super slow devices (e.g., cheap USB thumb
drives), perhaps we can measure the time needed to complete the
writeback, and then dynamically adjust the value based on the apparent
write bandwidth?

We could have each file system implement something like this, but
maybe there should be a way to do this in fs generic code?

- Ted