Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

f2fs: sysfs: introduce max_lock_elapsed_time

This patch add a new sysfs node in /sys/fs/f2fs/<device>/max_lock_elapsed_time.

This is a threshold, once a thread enters critical region that lock covers,
total elapsed time exceeds this threshold, f2fs will print tracepoint to dump
information of related context. This sysfs entry can be used to control the
value of threshold, by default, the value is 500 ms.

Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Chao Yu and committed by
Jaegeuk Kim
e4b75621 79b3cebc

+15 -1
+8
Documentation/ABI/testing/sysfs-fs-f2fs
··· 939 939 allocate_section_policy = 1 Prioritize writing to section before allocate_section_hint 940 940 allocate_section_policy = 2 Prioritize writing to section after allocate_section_hint 941 941 =========================== ========================================================== 942 + 943 + What: /sys/fs/f2fs/<disk>/max_lock_elapsed_time 944 + Date: December 2025 945 + Contact: "Chao Yu" <chao@kernel.org> 946 + Description: This is a threshold, once a thread enters critical region that lock covers, total 947 + elapsed time exceeds this threshold, f2fs will print tracepoint to dump information 948 + of related context. This sysfs entry can be used to control the value of threshold, 949 + by default, the value is 500 ms.
+1 -1
fs/f2fs/checkpoint.c
··· 66 66 get_lock_elapsed_time(&tts); 67 67 68 68 total_time = div_u64(tts.total_time - lc->ts.total_time, npm); 69 - if (total_time <= MAX_LOCK_ELAPSED_TIME) 69 + if (total_time <= sem->sbi->max_lock_elapsed_time) 70 70 return; 71 71 72 72 #ifdef CONFIG_64BIT
+3
fs/f2fs/f2fs.h
··· 1951 1951 /* carve out reserved_blocks from total blocks */ 1952 1952 bool carve_out; 1953 1953 1954 + /* max elapsed time threshold in critical region that lock covered */ 1955 + unsigned long long max_lock_elapsed_time; 1956 + 1954 1957 #ifdef CONFIG_F2FS_FS_COMPRESSION 1955 1958 struct kmem_cache *page_array_slab; /* page array entry */ 1956 1959 unsigned int page_array_slab_size; /* default page array slab size */
+1
fs/f2fs/super.c
··· 4295 4295 sbi->max_fragment_hole = DEF_FRAGMENT_SIZE; 4296 4296 spin_lock_init(&sbi->gc_remaining_trials_lock); 4297 4297 atomic64_set(&sbi->current_atomic_write, 0); 4298 + sbi->max_lock_elapsed_time = MAX_LOCK_ELAPSED_TIME; 4298 4299 4299 4300 sbi->dir_level = DEF_DIR_LEVEL; 4300 4301 sbi->interval_time[CP_TIME] = DEF_CP_INTERVAL;
+2
fs/f2fs/sysfs.c
··· 1219 1219 F2FS_SBI_GENERAL_RW_ATTR(carve_out); 1220 1220 F2FS_SBI_GENERAL_RW_ATTR(reserved_pin_section); 1221 1221 F2FS_SBI_GENERAL_RW_ATTR(bggc_io_aware); 1222 + F2FS_SBI_GENERAL_RW_ATTR(max_lock_elapsed_time); 1222 1223 1223 1224 /* STAT_INFO ATTR */ 1224 1225 #ifdef CONFIG_F2FS_STAT_FS ··· 1423 1422 ATTR_LIST(reserved_pin_section), 1424 1423 ATTR_LIST(allocate_section_hint), 1425 1424 ATTR_LIST(allocate_section_policy), 1425 + ATTR_LIST(max_lock_elapsed_time), 1426 1426 NULL, 1427 1427 }; 1428 1428 ATTRIBUTE_GROUPS(f2fs);