Skip to content

Commit f9f9360

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: trace elapsed time for node_change lock
Use f2fs_{down,up}_read_trace for node_change to trace lock elapsed time. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 66e9e0d commit f9f9360

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

fs/f2fs/data.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ static void f2fs_map_lock(struct f2fs_sb_info *sbi,
14721472
{
14731473
f2fs_down_read(&sbi->cp_enable_rwsem);
14741474
if (flag == F2FS_GET_BLOCK_PRE_AIO)
1475-
f2fs_down_read(&sbi->node_change);
1475+
f2fs_down_read_trace(&sbi->node_change, lc);
14761476
else
14771477
f2fs_lock_op(sbi, lc);
14781478
}
@@ -1482,7 +1482,7 @@ static void f2fs_map_unlock(struct f2fs_sb_info *sbi,
14821482
int flag)
14831483
{
14841484
if (flag == F2FS_GET_BLOCK_PRE_AIO)
1485-
f2fs_up_read(&sbi->node_change);
1485+
f2fs_up_read_trace(&sbi->node_change, lc);
14861486
else
14871487
f2fs_unlock_op(sbi, lc);
14881488
f2fs_up_read(&sbi->cp_enable_rwsem);

fs/f2fs/f2fs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ enum device_allocation_policy {
176176
enum f2fs_lock_name {
177177
LOCK_NAME_NONE,
178178
LOCK_NAME_CP_RWSEM,
179+
LOCK_NAME_NODE_CHANGE,
179180
};
180181

181182
/*

fs/f2fs/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4897,7 +4897,7 @@ static int f2fs_fill_super(struct super_block *sb, struct fs_context *fc)
48974897
mutex_init(&sbi->writepages);
48984898
init_f2fs_rwsem(&sbi->cp_global_sem);
48994899
init_f2fs_rwsem(&sbi->node_write);
4900-
init_f2fs_rwsem(&sbi->node_change);
4900+
init_f2fs_rwsem_trace(&sbi->node_change, sbi, LOCK_NAME_NODE_CHANGE);
49014901
spin_lock_init(&sbi->stat_lock);
49024902
init_f2fs_rwsem_trace(&sbi->cp_rwsem, sbi, LOCK_NAME_CP_RWSEM);
49034903
init_f2fs_rwsem(&sbi->cp_enable_rwsem);

include/trace/events/f2fs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ TRACE_DEFINE_ENUM(CP_PHASE_FINISH_CHECKPOINT);
186186

187187
#define show_lock_name(lock) \
188188
__print_symbolic(lock, \
189-
{ LOCK_NAME_CP_RWSEM, "cp_rwsem" })
189+
{ LOCK_NAME_CP_RWSEM, "cp_rwsem" }, \
190+
{ LOCK_NAME_NODE_CHANGE, "node_change" })
190191

191192
struct f2fs_sb_info;
192193
struct f2fs_io_info;

0 commit comments

Comments
 (0)