Skip to content

Commit 4cdca5a

Browse files
Daeho JeongJaegeuk Kim
authored andcommitted
f2fs: add reserved_segments sysfs node
For the fine tuning of GC behavior, add reserved_segments sysfs node. Signed-off-by: Daeho Jeong <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 8c890c4 commit 4cdca5a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Documentation/ABI/testing/sysfs-fs-f2fs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,3 +791,9 @@ Description: Controls migration window granularity of garbage collection on larg
791791
section. it can control the scanning window granularity for GC migration
792792
in a unit of segment, while migration_granularity controls the number
793793
of segments which can be migrated at the same turn.
794+
795+
What: /sys/fs/f2fs/<disk>/reserved_segments
796+
Date: September 2024
797+
Contact: "Daeho Jeong" <[email protected]>
798+
Description: In order to fine tune GC behavior, we can control the number of
799+
reserved segments.

fs/f2fs/sysfs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,7 @@ SM_INFO_GENERAL_RW_ATTR(min_fsync_blocks);
986986
SM_INFO_GENERAL_RW_ATTR(min_seq_blocks);
987987
SM_INFO_GENERAL_RW_ATTR(min_hot_blocks);
988988
SM_INFO_GENERAL_RW_ATTR(min_ssr_sections);
989+
SM_INFO_GENERAL_RW_ATTR(reserved_segments);
989990

990991
/* DCC_INFO ATTR */
991992
DCC_INFO_RW_ATTR(max_small_discards, max_discards);
@@ -1158,6 +1159,7 @@ static struct attribute *f2fs_attrs[] = {
11581159
ATTR_LIST(min_seq_blocks),
11591160
ATTR_LIST(min_hot_blocks),
11601161
ATTR_LIST(min_ssr_sections),
1162+
ATTR_LIST(reserved_segments),
11611163
ATTR_LIST(max_victim_search),
11621164
ATTR_LIST(migration_granularity),
11631165
ATTR_LIST(migration_window_granularity),

0 commit comments

Comments
 (0)