summaryrefslogtreecommitdiff
path: root/include/linux/writeback.h
diff options
context:
space:
mode:
authorHaifeng Xu <haifeng.xu@shopee.com>2024-07-26 11:05:25 +0800
committerChristian Brauner <brauner@kernel.org>2024-08-19 13:45:02 +0200
commitc393eaa85349941badf3ce5f087400dbaf3bbe02 (patch)
treee191d567644cfb12afcf720d93a2338475684e89 /include/linux/writeback.h
parente02bdb7208e7b5432cbe68392ae062810a7649fb (diff)
downloadlinux-c393eaa85349941badf3ce5f087400dbaf3bbe02.tar.gz
linux-c393eaa85349941badf3ce5f087400dbaf3bbe02.tar.bz2
linux-c393eaa85349941badf3ce5f087400dbaf3bbe02.zip
fs: don't flush in-flight wb switches for superblocks without cgroup writeback
When deactivating any type of superblock, it had to wait for the in-flight wb switches to be completed. wb switches are executed in inode_switch_wbs_work_fn() which needs to acquire the wb_switch_rwsem and races against sync_inodes_sb(). If there are too much dirty data in the superblock, the waiting time may increase significantly. For superblocks without cgroup writeback such as tmpfs, they have nothing to do with the wb swithes, so the flushing can be avoided. Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com> Link: https://lore.kernel.org/r/20240726030525.180330-1-haifeng.xu@shopee.com Reviewed-by: Jan Kara <jack@suse.cz> Suggested-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux/writeback.h')
-rw-r--r--include/linux/writeback.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 1a54676d843a..56b85841ae4c 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -217,7 +217,7 @@ void wbc_account_cgroup_owner(struct writeback_control *wbc, struct page *page,
size_t bytes);
int cgroup_writeback_by_id(u64 bdi_id, int memcg_id,
enum wb_reason reason, struct wb_completion *done);
-void cgroup_writeback_umount(void);
+void cgroup_writeback_umount(struct super_block *sb);
bool cleanup_offline_cgwb(struct bdi_writeback *wb);
/**
@@ -324,7 +324,7 @@ static inline void wbc_account_cgroup_owner(struct writeback_control *wbc,
{
}
-static inline void cgroup_writeback_umount(void)
+static inline void cgroup_writeback_umount(struct super_block *sb)
{
}