[f2fs-dev] [PATCH] f2fs: add a modify discard command function

2017-02-26 Thread Yunlei He
This patch add a function to modify discard command if one segment reuse before discard. Split this segment from multi-segments discard range, and discard the left bigger range. Signed-off-by: Yunlei He --- fs/f2fs/segment.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-

Re: [f2fs-dev] [PATCH] f2fs: avoid unnecessary fg_gc

2017-02-26 Thread Chao Yu
On 2017/2/26 3:39, Jaegeuk Kim wrote: > On 02/25, heyunlei wrote: >> Hi all, >> >> I am really confused by the condition below use sec_freed, is it always >> equal to zero? > > Seems it is always zero. Let's fix it together. > > Pengyang, > > I merged your patches and finally got this. > How do

Re: [f2fs-dev] [PATCH] f2fs: use MAX_FREE_NIDS for the free nids target

2017-02-26 Thread Chao Yu
On 2017/2/26 20:47, Kinglong Mee wrote: > F2FS has define MAX_FREE_NIDS for maximum of cached free nids target. > > #define MAX_FREE_NIDS (NAT_ENTRY_PER_BLOCK * FREE_NID_PAGES) > > Signed-off-by: Kinglong Mee All clean patches looks good to me. To Jaegeuk, please add: Reviewed-by: Chao Yu

Re: [f2fs-dev] [PATCH] f2fs: skip checkpoint if having a dirty segment but no prefree at BG_GC -> FG_GC

2017-02-26 Thread Chao Yu
On 2017/2/26 3:56, Jaegeuk Kim wrote: > On 02/25, guoweichao wrote: >> Hi Jaegeuk, >> >> I regard no enough free sections as a precondition when talking about >> BG_GC -> FG_GC. I mean that for both case a) and b) I mentioned has no enough >> free sections implicitly. >> >> On 2017/2/25 2:49, Jaeg

Re: [f2fs-dev] [PATCH 3/3] f2fs: drop calling alloc_nid_failed when no nid is allocated

2017-02-26 Thread Chao Yu
On 2017/2/27 11:08, Kinglong Mee wrote: > On 2/27/2017 10:21, Chao Yu wrote: >> On 2017/2/25 19:23, Kinglong Mee wrote: >>> If hsize is less than or equal to inlien_size, and i_xattr_nid is valid, >>> the new_nid is not allocated (no alloc_nid is called). >>> >>>if (hsize > inline_size &&

Re: [f2fs-dev] [PATCH V2] f2fs: introduce free nid bitmap

2017-02-26 Thread Chao Yu
On 2017/2/26 3:02, Jaegeuk Kim wrote: > On 02/25, Chao Yu wrote: >> Hi Jaegeuk, >> >> I added below diff code into this patch in order to fix incorrectly nid >> status >> updating to reduce large latency of generic/251 in fstest, could you help to >> review code below? > > Understand the problem,

Re: [f2fs-dev] [PATCH 3/3] f2fs: drop calling alloc_nid_failed when no nid is allocated

2017-02-26 Thread Kinglong Mee
On 2/27/2017 10:21, Chao Yu wrote: > On 2017/2/25 19:23, Kinglong Mee wrote: >> If hsize is less than or equal to inlien_size, and i_xattr_nid is valid, >> the new_nid is not allocated (no alloc_nid is called). >> >>if (hsize > inline_size && !F2FS_I(inode)->i_xattr_nid) >>

Re: [f2fs-dev] [PATCH 2/3] f2fs: add bitmaps for empty or full NAT blocks

2017-02-26 Thread Chao Yu
On 2017/2/26 2:34, Jaegeuk Kim wrote: > On 02/25, Chao Yu wrote: >> On 2017/2/24 6:54, Jaegeuk Kim wrote: >>> On 02/23, Chao Yu wrote: On 2017/2/14 10:06, Jaegeuk Kim wrote: > ... >>> > +static int scan_nat_bits(struct f2fs_sb_info *sbi) > +{ > + struct f2fs_nm_info *nm_i = NM_I(sb

Re: [f2fs-dev] [PATCH] f2fs: avoid unnecessary fg_gc

2017-02-26 Thread heyunlei
Hi Jaegeuk, On 2017/2/27 9:59, Hou Pengyang wrote: > We use has_not_enough_free_secs to check if there are enough free segments, > > (free_sections(sbi) + freed) <= > (node_secs + 2 * dent_secs + imeta_secs + > reserved_sections(sbi) + needed); Now node S

Re: [f2fs-dev] [PATCH 3/3] f2fs: drop calling alloc_nid_failed when no nid is allocated

2017-02-26 Thread Chao Yu
On 2017/2/25 19:23, Kinglong Mee wrote: > If hsize is less than or equal to inlien_size, and i_xattr_nid is valid, > the new_nid is not allocated (no alloc_nid is called). > >if (hsize > inline_size && !F2FS_I(inode)->i_xattr_nid) > if (!alloc_nid(sbi, &new_nid)) >

Re: [f2fs-dev] [PATCH 1/4] f2fs: avoid very large discard command

2017-02-26 Thread Chao Yu
On 2017/2/23 12:28, Jaegeuk Kim wrote: > This patch adds MAX_DISCARD_BLOCKS() to avoid issuing too much large single > discard command. > > Signed-off-by: Jaegeuk Kim This patch set looks good to me, please add reviewed-by into all patches. :) Reviewed-by: Chao Yu ---

Re: [f2fs-dev] [PATCH] f2fs: avoid unnecessary fg_gc

2017-02-26 Thread Hou Pengyang
On 2017/2/26 3:39, Jaegeuk Kim wrote: > On 02/25, heyunlei wrote: >> Hi all, >> >> I am really confused by the condition below use sec_freed, is it always >> equal to zero? > > Seems it is always zero. Let's fix it together. > > Pengyang, > > I merged your patches and finally got this. > How do yo

[f2fs-dev] [PATCH] mkfs.f2fs: check filesystem overwrite before formatting

2017-02-26 Thread Kinglong Mee
Mkfs.f2fs doesn't check the overwrite of exist filesystem. Avoid formatting an exist filesystem by mistake, a notice is important. The code is modified from xfsprogs. Signed-off-by: Kinglong Mee --- configure.ac| 20 +-- mkfs/Makefile.am| 4 +-- mkfs/f2fs_format_main

[f2fs-dev] [PATCH] f2fs: use MAX_FREE_NIDS for the free nids target

2017-02-26 Thread Kinglong Mee
F2FS has define MAX_FREE_NIDS for maximum of cached free nids target. #define MAX_FREE_NIDS (NAT_ENTRY_PER_BLOCK * FREE_NID_PAGES) Signed-off-by: Kinglong Mee --- fs/f2fs/node.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 6