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

Christoph Hellwig
2025-10-16T04:33:39Z

On Wed, Oct 15, 2025 at 11:13:53AM -0400, Theodore Ts'o wrote:
> 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?

Right now my main concern here is zoned file systems where the switching
directly leads to fragmentation. Besides XFS that would in theory also
affect f2fs and btrfs, but unlike XFS they do not do the trivial data
separation by inode but just throw all writes into the blender with (f2fs)
or without (btrfs) some hot cold separation applied. But even if they did
it finding the zone size is file system specific, so right now I don't see
much too share. If we end up with duplicate code I'll happily factor it
into helpers.

>
> - Ted
---end quoted text---