summaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorJinke Han <hanjinke.666@bytedance.com>2023-06-12 20:40:17 +0800
committerTheodore Ts'o <tytso@mit.edu>2023-10-05 21:48:03 -0400
commitce774e5365e46be73ed055302c6de123a03394ea (patch)
tree4e70a6a61055202735b7b5ad9858f5e127440b6a /fs/ext4/ext4.h
parenta8c1eb77edfc92a64788dad70fedf9277cbafe76 (diff)
downloadlinux-ce774e5365e46be73ed055302c6de123a03394ea.tar.gz
linux-ce774e5365e46be73ed055302c6de123a03394ea.tar.bz2
linux-ce774e5365e46be73ed055302c6de123a03394ea.zip
ext4: make running and commit transaction have their own freed_data_list
When releasing space in jbd, we traverse s_freed_data_list to get the free range belonging to the current commit transaction. In extreme cases, the time spent may not be small, and we have observed cases exceeding 10ms. This patch makes running and commit transactions manage their own free_data_list respectively, eliminating unnecessary traversal. And in the callback phase of the commit transaction, no one will touch it except the jbd thread itself, so s_md_lock is no longer needed. Signed-off-by: Jinke Han <hanjinke.666@bytedance.com> Reviewed-by: Zhang Yi <yi.zhang@huawei.com> Link: https://lore.kernel.org/r/20230612124017.14115-1-hanjinke.666@bytedance.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index cd4ccae1e28a..3b8bc44be528 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1564,7 +1564,7 @@ struct ext4_sb_info {
unsigned int *s_mb_maxs;
unsigned int s_group_info_size;
unsigned int s_mb_free_pending;
- struct list_head s_freed_data_list; /* List of blocks to be freed
+ struct list_head s_freed_data_list[2]; /* List of blocks to be freed
after commit completed */
struct list_head s_discard_list;
struct work_struct s_discard_work;