]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge tag 'vfs-6.19-rc1.writeback' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 1 Dec 2025 17:20:51 +0000 (09:20 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 1 Dec 2025 17:20:51 +0000 (09:20 -0800)
Pull writeback updates from Christian Brauner:
 "Features:

   - Allow file systems to increase the minimum writeback chunk size.

     The relatively low minimal writeback size of 4MiB 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.

     This adds a superblock field that allows the file system to
     override the default size, and sets it to the zone size for zoned
     XFS.

   - Add logging for slow writeback when it exceeds
     sysctl_hung_task_timeout_secs. This helps identify tasks waiting
     for a long time and pinpoint potential issues. Recording the
     starting jiffies is also useful when debugging a crashed vmcore.

   - Wake up waiting tasks when finishing the writeback of a chunk

  Cleanups:

   - filemap_* writeback interface cleanups.

     Adding filemap_fdatawrite_wbc ended up being a mistake, as all but
     the original btrfs caller should be using better high level
     interfaces instead.

     This series removes all these low-level interfaces, switches btrfs
     to a more specific interface, and cleans up other too low-level
     interfaces. With this the writeback_control that is passed to the
     writeback code is only initialized in three places.

   - Remove __filemap_fdatawrite, __filemap_fdatawrite_range, and
     filemap_fdatawrite_wbc

   - Add filemap_flush_nr helper for btrfs

   - Push struct writeback_control into start_delalloc_inodes in btrfs

   - Rename filemap_fdatawrite_range_kick to filemap_flush_range

   - Stop opencoding filemap_fdatawrite_range in 9p, ocfs2, and mm

   - Make wbc_to_tag() inline and use it in fs"

* tag 'vfs-6.19-rc1.writeback' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
  fs: Make wbc_to_tag() inline and use it in fs.
  xfs: set s_min_writeback_pages for zoned file systems
  writeback: allow the file system to override MIN_WRITEBACK_PAGES
  writeback: cleanup writeback_chunk_size
  mm: rename filemap_fdatawrite_range_kick to filemap_flush_range
  mm: remove __filemap_fdatawrite_range
  mm: remove filemap_fdatawrite_wbc
  mm: remove __filemap_fdatawrite
  mm,btrfs: add a filemap_flush_nr helper
  btrfs: push struct writeback_control into start_delalloc_inodes
  btrfs: use the local tmp_inode variable in start_delalloc_inodes
  ocfs2: don't opencode filemap_fdatawrite_range in ocfs2_journal_submit_inode_data_buffers
  9p: don't opencode filemap_fdatawrite_range in v9fs_mmap_vm_close
  mm: don't opencode filemap_fdatawrite_range in filemap_invalidate_inode
  writeback: Add logging for slow writeback (exceeds sysctl_hung_task_timeout_secs)
  writeback: Wake up waiting tasks when finishing the writeback of a chunk.

13 files changed:
1  2 
fs/btrfs/extent_io.c
fs/btrfs/inode.c
fs/ext4/inode.c
fs/f2fs/data.c
fs/fs-writeback.c
fs/gfs2/aops.c
fs/super.c
fs/sync.c
fs/xfs/xfs_zone_alloc.c
include/linux/fs.h
include/linux/pagemap.h
include/linux/writeback.h
mm/filemap.c

Simple merge
Simple merge
diff --cc fs/ext4/inode.c
Simple merge
diff --cc fs/f2fs/data.c
Simple merge
index 917a450c503becd76c877ca9889fff3dbd7bb13f,52763fa499d62446ed326932d96f6c109016cbd6..6800886c4d1047b28c5c07613a1a1b256e982a95
@@@ -2009,10 -2008,10 +2016,10 @@@ static long writeback_sb_inodes(struct 
                        spin_lock(&wb->list_lock);
                        continue;
                }
 -              inode->i_state |= I_SYNC;
 +              inode_state_set(inode, I_SYNC);
                wbc_attach_and_unlock_inode(&wbc, inode);
  
-               write_chunk = writeback_chunk_size(wb, work);
+               write_chunk = writeback_chunk_size(inode->i_sb, wb, work);
                wbc.nr_to_write = write_chunk;
                wbc.pages_skipped = 0;
  
diff --cc fs/gfs2/aops.c
Simple merge
diff --cc fs/super.c
Simple merge
diff --cc fs/sync.c
Simple merge
Simple merge
Simple merge
Simple merge
index 102071ffedcb5ce908f63f97b9075901a6856e57,2a81816f7507ac5598e199fc8646507034d5c0a8..f48e8ccffe81dfb6e22e77755e4b08f671c3432e
@@@ -189,6 -189,20 +189,13 @@@ void wakeup_flusher_threads_bdi(struct 
  void inode_wait_for_writeback(struct inode *inode);
  void inode_io_list_del(struct inode *inode);
  
 -/* writeback.h requires fs.h; it, too, is not included from here. */
 -static inline void wait_on_inode(struct inode *inode)
 -{
 -      wait_var_event(inode_state_wait_address(inode, __I_NEW),
 -                     !(READ_ONCE(inode->i_state) & I_NEW));
 -}
 -
+ static inline xa_mark_t wbc_to_tag(struct writeback_control *wbc)
+ {
+       if (wbc->sync_mode == WB_SYNC_ALL || wbc->tagged_writepages)
+               return PAGECACHE_TAG_TOWRITE;
+       return PAGECACHE_TAG_DIRTY;
+ }
  #ifdef CONFIG_CGROUP_WRITEBACK
  
  #include <linux/cgroup.h>
diff --cc mm/filemap.c
Simple merge