From: Daeho Jeong <daehojeong@xxxxxxxxxx>
Added gc_dirty_segs and gc_dirty_segs_mode sysfs nodes.
1) "gc_dirty_segs" shows how many dirty segments have been
reclaimed by GC during a specific GC mode.
2) "gc_dirty_segs_mode" is used to control for which gc mode
the "gc_dirty_segs" node shows.
Signed-off-by: Daeho Jeong <daehojeong@xxxxxxxxxx>
---
Documentation/ABI/testing/sysfs-fs-f2fs | 14 +++++++++++++
fs/f2fs/debug.c | 9 ++++++++
fs/f2fs/f2fs.h | 5 +++++
fs/f2fs/gc.c | 1 +
fs/f2fs/sysfs.c | 28 +++++++++++++++++++++++++
5 files changed, 57 insertions(+)
diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs
index 95155e4ec7fe..0d863eb185f6 100644
--- a/Documentation/ABI/testing/sysfs-fs-f2fs
+++ b/Documentation/ABI/testing/sysfs-fs-f2fs
@@ -493,3 +493,17 @@ Contact: "Chao Yu" <yuchao0@xxxxxxxxxx>
Description: When ATGC is on, it controls age threshold to bypass GCing young
candidates whose age is not beyond the threshold, by default it was
initialized as 604800 seconds (equals to 7 days).
+
+What: /sys/fs/f2fs/<disk>/gc_dirty_segs
+Date: July 2021
+Contact: "Daeho Jeong" <daehojeong@xxxxxxxxxx>
+Description: Show how many dirty segments have been reclaimed by GC during
+ a specific GC mode (0: GC normal, 1: GC idle CB, 2: GC idle greedy,
+ 3: gc idle AT, 4: GC urgent high, 5: GC urgent low)
+ You can re-initialize this value to "0".
+
+What: /sys/fs/f2fs/<disk>/gc_dirty_segs_mode