summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2025-10-29 17:54:36 +0300
committerChristian Brauner <brauner@kernel.org>2025-10-29 17:54:36 +0300
commit891bea757c771dca47e871444faecb1ed642a311 (patch)
treeeb814e06688a4d12c06424a60d497738b5a47c73 /include/linux
parent211c43d0938dd57c2937366339f8b651e7990d1a (diff)
parent015a54407782309c11655e1938bcbcef131ebf87 (diff)
downloadlinux-891bea757c771dca47e871444faecb1ed642a311.tar.xz
Merge patch series "allow file systems to increase the minimum writeback chunk size v2"
Christoph Hellwig <hch@lst.de> says: 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. * patches from https://patch.msgid.link/20251017034611.651385-1-hch@lst.de: 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 Link: https://patch.msgid.link/20251017034611.651385-1-hch@lst.de Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h1
-rw-r--r--include/linux/writeback.h5
2 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a5dbfa20f8d7..6bf369095d2e 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 */
+ long s_min_writeback_pages;
} __randomize_layout;
static inline struct user_namespace *i_user_ns(const struct inode *inode)
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 22dd4adc5667..49e1dd96f43e 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -374,4 +374,9 @@ bool redirty_page_for_writepage(struct writeback_control *, struct page *);
void sb_mark_inode_writeback(struct inode *inode);
void sb_clear_inode_writeback(struct inode *inode);
+/*
+ * 4MB minimal write chunk size
+ */
+#define MIN_WRITEBACK_PAGES (4096UL >> (PAGE_SHIFT - 10))
+
#endif /* WRITEBACK_H */