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

Commit e07cead0 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

f2fs: add a way to turn off ipu bio cache



Setting 0x40 in /sys/fs/f2fs/dev/ipu_policy gives a way to turn off
bio cache, which is useufl to check whether block layer using hardware
encryption engine merges IOs correctly.

Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 1840be7e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -331,10 +331,11 @@ Files in /sys/fs/f2fs/<devname>
                              conducts. 32 sections is set by default.

 ipu_policy                   This parameter controls the policy of in-place
                              updates in f2fs. There are five policies:
                              updates in f2fs. User can set:
                               0x01: F2FS_IPU_FORCE, 0x02: F2FS_IPU_SSR,
                               0x04: F2FS_IPU_UTIL,  0x08: F2FS_IPU_SSR_UTIL,
                               0x10: F2FS_IPU_FSYNC.
                               0x10: F2FS_IPU_FSYNC, 0x40: F2FS_IPU_NOCACHE.
                              Refer segment.h for details.

 min_ipu_util                 This parameter controls the threshold to trigger
                              in-place-updates. The number indicates percentage
+1 −1
Original line number Diff line number Diff line
@@ -3289,7 +3289,7 @@ int f2fs_inplace_write_data(struct f2fs_io_info *fio)

	stat_inc_inplace_blocks(fio->sbi);

	if (fio->bio)
	if (fio->bio && !(SM_I(sbi)->ipu_policy & (1 << F2FS_IPU_NOCACHE)))
		err = f2fs_merge_page_bio(fio);
	else
		err = f2fs_submit_page_bio(fio);
+2 −0
Original line number Diff line number Diff line
@@ -608,6 +608,7 @@ static inline int utilization(struct f2fs_sb_info *sbi)
 * F2FS_IPU_FSYNC - activated in fsync path only for high performance flash
 *                     storages. IPU will be triggered only if the # of dirty
 *                     pages over min_fsync_blocks.
 * F2FS_IPU_NOCACHE - disable IPU bio cache.
 * F2FS_IPUT_DISABLE - disable IPU. (=default option)
 */
#define DEF_MIN_IPU_UTIL	70
@@ -623,6 +624,7 @@ enum {
	F2FS_IPU_SSR_UTIL,
	F2FS_IPU_FSYNC,
	F2FS_IPU_ASYNC,
	F2FS_IPU_NOCACHE,
};

static inline unsigned int curseg_segno(struct f2fs_sb_info *sbi,