diff mbox series

[RFC,v4,3/8] ext4: use extent status tree in fast commit path

Message ID 20220721060246.1696852-4-harshadshirwadkar@gmail.com
State Under Review
Delegated to: Theodore Ts'o
Headers show
Series Ext4 fast commit performance patch series | expand

Commit Message

harshad shirwadkar July 21, 2022, 6:02 a.m. UTC
This patch moves fc commit path to use extent status tree to lookup
logical to physical mappings. In order to preserve the uncommitted
entries in the es cache, this patch makes all the inodes on fast
commit list as shrinker ineligible. Making the uncommitted entries in
es cache to stick around is left as a future enhancement.

Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
---
 fs/ext4/extents_status.c | 3 ++-
 fs/ext4/fast_commit.c    | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
index 9a3a8996aacf..07fb86746534 100644
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -1500,7 +1500,8 @@  static int __es_shrink(struct ext4_sb_info *sbi, int nr_to_scan,
 			continue;
 		}
 
-		if (ei == locked_ei || !write_trylock(&ei->i_es_lock)) {
+		if (!list_empty(&ei->i_fc_list) || ei == locked_ei ||
+			!write_trylock(&ei->i_es_lock)) {
 			nr_skipped++;
 			continue;
 		}
diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
index 4d2384adcbb0..916f62cfa7f7 100644
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -951,7 +951,8 @@  static int ext4_fc_write_inode_data(struct inode *inode, u32 *crc)
 	while (cur_lblk_off <= new_blk_size) {
 		map.m_lblk = cur_lblk_off;
 		map.m_len = new_blk_size - cur_lblk_off + 1;
-		ret = ext4_map_blocks(NULL, inode, &map, 0);
+		ret = ext4_map_blocks(NULL, inode, &map,
+			EXT4_GET_BLOCKS_CACHED_NOWAIT);
 		if (ret < 0)
 			return -ECANCELED;