ext4: make running and commit transaction have their own freed_data_list
authorJinke Han <hanjinke.666@bytedance.com>
Mon, 12 Jun 2023 12:40:17 +0000 (20:40 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 6 Oct 2023 01:48:03 +0000 (21:48 -0400)
commitce774e5365e46be73ed055302c6de123a03394ea
tree4e70a6a61055202735b7b5ad9858f5e127440b6a
parenta8c1eb77edfc92a64788dad70fedf9277cbafe76
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>
fs/ext4/ext4.h
fs/ext4/mballoc.c