Loading Documentation/filesystems/f2fs.txt +3 −3 Original line number Diff line number Diff line Loading @@ -192,9 +192,9 @@ Files in /sys/fs/f2fs/<devname> ipu_policy This parameter controls the policy of in-place updates in f2fs. There are five policies: 0: F2FS_IPU_FORCE, 1: F2FS_IPU_SSR, 2: F2FS_IPU_UTIL, 3: F2FS_IPU_SSR_UTIL, 4: F2FS_IPU_FSYNC, 5: F2FS_IPU_DISABLE. 0x01: F2FS_IPU_FORCE, 0x02: F2FS_IPU_SSR, 0x04: F2FS_IPU_UTIL, 0x08: F2FS_IPU_SSR_UTIL, 0x10: F2FS_IPU_FSYNC. min_ipu_util This parameter controls the threshold to trigger in-place-updates. The number indicates percentage Loading fs/f2fs/segment.c +1 −1 Original line number Diff line number Diff line Loading @@ -1928,7 +1928,7 @@ int build_segment_manager(struct f2fs_sb_info *sbi) sm_info->ssa_blkaddr = le32_to_cpu(raw_super->ssa_blkaddr); sm_info->rec_prefree_segments = sm_info->main_segments * DEF_RECLAIM_PREFREE_SEGMENTS / 100; sm_info->ipu_policy = F2FS_IPU_FSYNC; sm_info->ipu_policy = 1 << F2FS_IPU_FSYNC; sm_info->min_ipu_util = DEF_MIN_IPU_UTIL; sm_info->min_fsync_blocks = DEF_MIN_FSYNC_BLOCKS; Loading fs/f2fs/segment.h +16 −23 Original line number Diff line number Diff line Loading @@ -487,40 +487,33 @@ enum { F2FS_IPU_UTIL, F2FS_IPU_SSR_UTIL, F2FS_IPU_FSYNC, F2FS_IPU_DISABLE, }; static inline bool need_inplace_update(struct inode *inode) { struct f2fs_sb_info *sbi = F2FS_I_SB(inode); unsigned int policy = SM_I(sbi)->ipu_policy; /* IPU can be done only for the user data */ if (S_ISDIR(inode->i_mode)) return false; switch (SM_I(sbi)->ipu_policy) { case F2FS_IPU_FORCE: if (policy & (0x1 << F2FS_IPU_FORCE)) return true; case F2FS_IPU_SSR: if (need_SSR(sbi)) if (policy & (0x1 << F2FS_IPU_SSR) && need_SSR(sbi)) return true; break; case F2FS_IPU_UTIL: if (utilization(sbi) > SM_I(sbi)->min_ipu_util) if (policy & (0x1 << F2FS_IPU_UTIL) && utilization(sbi) > SM_I(sbi)->min_ipu_util) return true; break; case F2FS_IPU_SSR_UTIL: if (need_SSR(sbi) && utilization(sbi) > SM_I(sbi)->min_ipu_util) if (policy & (0x1 << F2FS_IPU_SSR_UTIL) && need_SSR(sbi) && utilization(sbi) > SM_I(sbi)->min_ipu_util) return true; break; case F2FS_IPU_FSYNC: /* this is only set during fdatasync */ if (is_inode_flag_set(F2FS_I(inode), FI_NEED_IPU)) if (policy & (0x1 << F2FS_IPU_FSYNC) && is_inode_flag_set(F2FS_I(inode), FI_NEED_IPU)) return true; break; case F2FS_IPU_DISABLE: break; } return false; } Loading Loading
Documentation/filesystems/f2fs.txt +3 −3 Original line number Diff line number Diff line Loading @@ -192,9 +192,9 @@ Files in /sys/fs/f2fs/<devname> ipu_policy This parameter controls the policy of in-place updates in f2fs. There are five policies: 0: F2FS_IPU_FORCE, 1: F2FS_IPU_SSR, 2: F2FS_IPU_UTIL, 3: F2FS_IPU_SSR_UTIL, 4: F2FS_IPU_FSYNC, 5: F2FS_IPU_DISABLE. 0x01: F2FS_IPU_FORCE, 0x02: F2FS_IPU_SSR, 0x04: F2FS_IPU_UTIL, 0x08: F2FS_IPU_SSR_UTIL, 0x10: F2FS_IPU_FSYNC. min_ipu_util This parameter controls the threshold to trigger in-place-updates. The number indicates percentage Loading
fs/f2fs/segment.c +1 −1 Original line number Diff line number Diff line Loading @@ -1928,7 +1928,7 @@ int build_segment_manager(struct f2fs_sb_info *sbi) sm_info->ssa_blkaddr = le32_to_cpu(raw_super->ssa_blkaddr); sm_info->rec_prefree_segments = sm_info->main_segments * DEF_RECLAIM_PREFREE_SEGMENTS / 100; sm_info->ipu_policy = F2FS_IPU_FSYNC; sm_info->ipu_policy = 1 << F2FS_IPU_FSYNC; sm_info->min_ipu_util = DEF_MIN_IPU_UTIL; sm_info->min_fsync_blocks = DEF_MIN_FSYNC_BLOCKS; Loading
fs/f2fs/segment.h +16 −23 Original line number Diff line number Diff line Loading @@ -487,40 +487,33 @@ enum { F2FS_IPU_UTIL, F2FS_IPU_SSR_UTIL, F2FS_IPU_FSYNC, F2FS_IPU_DISABLE, }; static inline bool need_inplace_update(struct inode *inode) { struct f2fs_sb_info *sbi = F2FS_I_SB(inode); unsigned int policy = SM_I(sbi)->ipu_policy; /* IPU can be done only for the user data */ if (S_ISDIR(inode->i_mode)) return false; switch (SM_I(sbi)->ipu_policy) { case F2FS_IPU_FORCE: if (policy & (0x1 << F2FS_IPU_FORCE)) return true; case F2FS_IPU_SSR: if (need_SSR(sbi)) if (policy & (0x1 << F2FS_IPU_SSR) && need_SSR(sbi)) return true; break; case F2FS_IPU_UTIL: if (utilization(sbi) > SM_I(sbi)->min_ipu_util) if (policy & (0x1 << F2FS_IPU_UTIL) && utilization(sbi) > SM_I(sbi)->min_ipu_util) return true; break; case F2FS_IPU_SSR_UTIL: if (need_SSR(sbi) && utilization(sbi) > SM_I(sbi)->min_ipu_util) if (policy & (0x1 << F2FS_IPU_SSR_UTIL) && need_SSR(sbi) && utilization(sbi) > SM_I(sbi)->min_ipu_util) return true; break; case F2FS_IPU_FSYNC: /* this is only set during fdatasync */ if (is_inode_flag_set(F2FS_I(inode), FI_NEED_IPU)) if (policy & (0x1 << F2FS_IPU_FSYNC) && is_inode_flag_set(F2FS_I(inode), FI_NEED_IPU)) return true; break; case F2FS_IPU_DISABLE: break; } return false; } Loading