Skip to content

Commit 55a8ded

Browse files
chaseyuintel-lab-lkp
authored andcommitted
f2fs: dump more information when checkpoint was blocked for long time
generic/299 w/ mode=lfs will cause long time latency, let's dump more information once we hit case. CP merge: - Queued : 0 - Issued : 1 - Total : 1 - Cur time : 7565(ms) - Peak time : 7565(ms) F2FS-fs (vdc): checkpoint was blocked for 7565 ms, affecting 1 tasks CPU: 8 UID: 0 PID: 1614 Comm: f2fs_ckpt-253:3 Tainted: G O 6.16.0-rc3+ torvalds#406 PREEMPT(voluntary) Tainted: [O]=OOT_MODULE Call Trace: dump_stack_lvl+0x6e/0xa0 __checkpoint_and_complete_reqs+0x1a6/0x1d0 issue_checkpoint_thread+0x4b/0x140 kthread+0x10d/0x250 ret_from_fork+0x164/0x190 ret_from_fork_asm+0x1a/0x30 Cc: Jan Prusakowski <[email protected]> Signed-off-by: Chao Yu <[email protected]>
1 parent 137af63 commit 55a8ded

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

fs/f2fs/checkpoint.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1788,8 +1788,15 @@ static void __checkpoint_and_complete_reqs(struct f2fs_sb_info *sbi)
17881788

17891789
spin_lock(&cprc->stat_lock);
17901790
cprc->cur_time = (unsigned int)div64_u64(sum_diff, count);
1791-
if (cprc->peak_time < cprc->cur_time)
1791+
if (cprc->peak_time < cprc->cur_time) {
17921792
cprc->peak_time = cprc->cur_time;
1793+
1794+
if (unlikely(cprc->peak_time >= CP_LONG_LATENCY_THRESHOLD)) {
1795+
f2fs_warn_ratelimited(sbi, "checkpoint was blocked for %u ms, affecting %llu tasks",
1796+
cprc->peak_time, count);
1797+
dump_stack();
1798+
}
1799+
}
17931800
spin_unlock(&cprc->stat_lock);
17941801
}
17951802

fs/f2fs/f2fs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,9 @@ struct ckpt_req_control {
350350
unsigned int peak_time; /* peak wait time in msec until now */
351351
};
352352

353+
/* a time threshold that checkpoint was blocked for, unit: ms */
354+
#define CP_LONG_LATENCY_THRESHOLD 5000
355+
353356
/* for the bitmap indicate blocks to be discarded */
354357
struct discard_entry {
355358
struct list_head list; /* list head */

0 commit comments

Comments
 (0)