Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2a12b67 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

f2fs: export SSR allocation threshold



This patch exports min_ssr_segments threshold in sysfs to let user
control triggering SSR allocation flexibly.

Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 0ea80512
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -57,6 +57,12 @@ Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
Description:
		 Controls the dirty page count condition for redefining hot data.

What:		/sys/fs/f2fs/<disk>/min_ssr_sections
Date:		October 2017
Contact:	"Chao Yu" <yuchao0@huawei.com>
Description:
		 Controls the fee section threshold to trigger SSR allocation.

What:		/sys/fs/f2fs/<disk>/max_small_discards
Date:		November 2013
Contact:	"Jaegeuk Kim" <jaegeuk.kim@samsung.com>
+2 −0
Original line number Diff line number Diff line
@@ -840,6 +840,7 @@ struct f2fs_sm_info {
	unsigned int min_ipu_util;	/* in-place-update threshold */
	unsigned int min_fsync_blocks;	/* threshold for fsync */
	unsigned int min_hot_blocks;	/* threshold for hot block allocation */
	unsigned int min_ssr_sections;	/* threshold to trigger SSR allocation */

	/* for flush command control */
	struct flush_cmd_control *fcc_info;
@@ -1077,6 +1078,7 @@ struct f2fs_sb_info {
	int active_logs;			/* # of active logs */
	int dir_level;				/* directory level */
	int inline_xattr_size;			/* inline xattr size */
	unsigned int trigger_ssr_threshold;	/* threshold to trigger ssr */

	block_t user_block_count;		/* # of user blocks */
	block_t total_valid_block_count;	/* # of valid blocks */
+2 −1
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ bool need_SSR(struct f2fs_sb_info *sbi)
		return true;

	return free_sections(sbi) <= (node_secs + 2 * dent_secs + imeta_secs +
						2 * reserved_sections(sbi));
			SM_I(sbi)->min_ssr_sections + reserved_sections(sbi));
}

void register_inmem_page(struct inode *inode, struct page *page)
@@ -3671,6 +3671,7 @@ int build_segment_manager(struct f2fs_sb_info *sbi)
	sm_info->min_ipu_util = DEF_MIN_IPU_UTIL;
	sm_info->min_fsync_blocks = DEF_MIN_FSYNC_BLOCKS;
	sm_info->min_hot_blocks = DEF_MIN_HOT_BLOCKS;
	sm_info->min_ssr_sections = reserved_sections(sbi);

	sm_info->trim_sections = DEF_BATCHED_TRIM_SECTIONS;

+2 −0
Original line number Diff line number Diff line
@@ -285,6 +285,7 @@ F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, ipu_policy, ipu_policy);
F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, min_ipu_util, min_ipu_util);
F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, min_fsync_blocks, min_fsync_blocks);
F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, min_hot_blocks, min_hot_blocks);
F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, min_ssr_sections, min_ssr_sections);
F2FS_RW_ATTR(NM_INFO, f2fs_nm_info, ram_thresh, ram_thresh);
F2FS_RW_ATTR(NM_INFO, f2fs_nm_info, ra_nid_pages, ra_nid_pages);
F2FS_RW_ATTR(NM_INFO, f2fs_nm_info, dirty_nats_ratio, dirty_nats_ratio);
@@ -330,6 +331,7 @@ static struct attribute *f2fs_attrs[] = {
	ATTR_LIST(min_ipu_util),
	ATTR_LIST(min_fsync_blocks),
	ATTR_LIST(min_hot_blocks),
	ATTR_LIST(min_ssr_sections),
	ATTR_LIST(max_victim_search),
	ATTR_LIST(dir_level),
	ATTR_LIST(ram_thresh),