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

Damien Le Moal
2025-10-15T07:09:17Z

On 2025/10/15 15:27, Christoph Hellwig wrote:
> The relatively low minimal writeback size of 4MiB leads means that

Removes "leads" in the above.

> 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.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index c895146c1444..23f1f10646b7 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1583,6 +1583,7 @@ struct super_block {
>
> spinlock_t s_inode_wblist_lock;
> struct list_head s_inodes_wb; /* writeback inodes */
> + unsigned int s_min_writeback_pages;

Given that writeback_chunk_size() returns a long type, maybe this should be a long ?

> } __randomize_layout;
>
> static inline struct user_namespace *i_user_ns(const struct inode *inode)

--
Damien Le Moal
Western Digital Research