[f2fs-dev] [PATCH] f2fs: skip scanning free nid bitmap of full NAT blocks

2017-03-01 Thread Chao Yu
This patch adds to account free nids for each NAT blocks, and while scanning all free nid bitmap, do check count and skip lookuping in full NAT block. Signed-off-by: Chao Yu --- fs/f2fs/debug.c | 1 + fs/f2fs/f2fs.h | 2 ++ fs/f2fs/node.c | 34 -- 3 files chan

[f2fs-dev] [PATCH RFC] f2fs: combine nat_bits and free_nid_bitmap cache

2017-03-01 Thread Chao Yu
Both nat_bits cache and free_nid_bitmap cache provide same functionality as a intermediate cache between free nid cache and disk, but with different granularity of indicating free nid range, and different persistence policy. nat_bits cache provides better persistence ability, and free_nid_bitmap pr

[f2fs-dev] [PATCH] f2fs: skip writeback meta pages if cp_mutex acquire failed

2017-03-01 Thread Yunlei He
Skip writeback meta pages if cp_mutex lock acquire failed, cp will flush dirty pages instead. Signed-off-by: Yunlei He --- fs/f2fs/checkpoint.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 0339daf..5ce24b1 1006

Re: [f2fs-dev] [PATCH] f2fs: skip writeback meta pages if cp_mutex acquire failed

2017-03-01 Thread Chao Yu
On 2017/3/1 17:21, Yunlei He wrote: > Skip writeback meta pages if cp_mutex lock acquire failed, cp will > flush dirty pages instead. Make sense to me. :) > > Signed-off-by: Yunlei He > --- > fs/f2fs/checkpoint.c | 12 +++- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --

Re: [f2fs-dev] [PATCH] f2fs: skip writeback meta pages if cp_mutex acquire failed

2017-03-01 Thread heyunlei
Hi Chao, On 2017/3/1 17:32, Chao Yu wrote: > On 2017/3/1 17:21, Yunlei He wrote: >> Skip writeback meta pages if cp_mutex lock acquire failed, cp will >> flush dirty pages instead. > > Make sense to me. :) > >> >> Signed-off-by: Yunlei He >> --- >> fs/f2fs/checkpoint.c | 12 +++- >> 1 fi

[f2fs-dev] [PATCH v2] f2fs: skip writeback meta pages if cp_mutex acquire failed

2017-03-01 Thread Yunlei He
Skip writeback meta pages if cp_mutex lock acquire failed, cp will flush dirty pages instead. Signed-off-by: Yunlei He --- fs/f2fs/checkpoint.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 0339daf..91734cc 100644 ---

Re: [f2fs-dev] [PATCH RFC] f2fs: combine nat_bits and free_nid_bitmap cache

2017-03-01 Thread Kinglong Mee
On 3/1/2017 17:10, Chao Yu wrote: > Both nat_bits cache and free_nid_bitmap cache provide same functionality > as a intermediate cache between free nid cache and disk, but with > different granularity of indicating free nid range, and different > persistence policy. nat_bits cache provides better p

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

2017-03-01 Thread Jaegeuk Kim
On 02/28, Chao Yu wrote: > On 2017/2/28 7:49, Jaegeuk Kim wrote: > > On 02/27, Jaegeuk Kim wrote: > >> On 02/27, Chao Yu wrote: > >>> 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

Re: [f2fs-dev] [PATCH] f2fs: fix an error return value in truncate_partial_data_page

2017-03-01 Thread Jaegeuk Kim
On 03/01, Chao Yu wrote: > On 2017/2/28 20:32, Yunlei He wrote: > > This patch fix a error return value in truncate_partial_data_page > > > > Signed-off-by: Yunlei He > > --- > > fs/f2fs/file.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/fs/f2fs/file.c b/fs/f2

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

2017-03-01 Thread Jaegeuk Kim
Hi Chao, BTW, we need to add a shrinker for this as well, right? Thanks, On 02/23, Chao Yu wrote: > In scenario of intensively node allocation, free nids will be ran out > soon, then it needs to stop to load free nids by traversing NAT blocks, > in worse case, if NAT blocks does not be cached in

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

2017-03-01 Thread Jaegeuk Kim
On 02/28, heyunlei wrote: > Hi Jaegeuk, > > On 2017/2/28 7:08, Jaegeuk Kim wrote: > > On 02/27, Yunlei He wrote: > > > 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 big

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

2017-03-01 Thread Chao Yu
Hi Jaegeuk, On 2017/3/2 3:35, Jaegeuk Kim wrote: > Hi Chao, > > BTW, we need to add a shrinker for this as well, right? Hmm...do we really have to? As at most we will have 3900 NAT blocks, so a. free_nid_bitmap: 3900 * 57 = ~217 KB b. nat_block_bitmap:3900 / 8 = ~487 BYTE c. free_nid_co

Re: [f2fs-dev] [PATCH RFC] f2fs: combine nat_bits and free_nid_bitmap cache

2017-03-01 Thread Chao Yu
On 2017/3/1 21:09, Kinglong Mee wrote: > On 3/1/2017 17:10, Chao Yu wrote: >> Both nat_bits cache and free_nid_bitmap cache provide same functionality >> as a intermediate cache between free nid cache and disk, but with >> different granularity of indicating free nid range, and different >> persist

Re: [f2fs-dev] [PATCH v2] f2fs: skip writeback meta pages if cp_mutex acquire failed

2017-03-01 Thread Chao Yu
On 2017/3/1 18:07, Yunlei He wrote: > Skip writeback meta pages if cp_mutex lock acquire failed, cp will > flush dirty pages instead. > > Signed-off-by: Yunlei He Reviewed-by: Chao Yu Thanks, -- Check out the vibrant

Re: [f2fs-dev] [PATCH] f2fs: fix an error return value in truncate_partial_data_page

2017-03-01 Thread Chao Yu
On 2017/3/2 3:32, Jaegeuk Kim wrote: > On 03/01, Chao Yu wrote: >> On 2017/2/28 20:32, Yunlei He wrote: >>> This patch fix a error return value in truncate_partial_data_page >>> >>> Signed-off-by: Yunlei He >>> --- >>> fs/f2fs/file.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >

Re: [f2fs-dev] [PATCH] f2fs: fix an error return value in truncate_partial_data_page

2017-03-01 Thread heyunlei
Hi Jaegeuk, On 2017/3/2 3:32, Jaegeuk Kim wrote: > On 03/01, Chao Yu wrote: >> On 2017/2/28 20:32, Yunlei He wrote: >>> This patch fix a error return value in truncate_partial_data_page >>> >>> Signed-off-by: Yunlei He >>> --- >>> fs/f2fs/file.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 dele

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

2017-03-01 Thread heyunlei
Hi Jaegeuk, On 2017/3/2 3:48, Jaegeuk Kim wrote: > On 02/28, heyunlei wrote: >> Hi Jaegeuk, >> >> On 2017/2/28 7:08, Jaegeuk Kim wrote: >>> On 02/27, Yunlei He wrote: This patch add a function to modify discard command if one segment reuse before discard. Split this segment from multi-se

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

2017-03-01 Thread Yunlei He
This patch add a function to punch 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(-)

[f2fs-dev] [PATCH] f2fs: correct cp_ver for compatibility to old image

2017-03-01 Thread Chao Yu
There is no CP_CRC_RECOVERY_FLAG tagged in checkpoint pack, calculate cp_version as old format. Signed-off-by: Chao Yu --- fs/f2fs/node.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 6c027b6833f4..0d46404ca769 100644 --- a/fs/f2fs/n

[f2fs-dev] [PATCH] f2fs-tools: calculate cp_ver correctly

2017-03-01 Thread Chao Yu
It needs to check CP_CRC_RECOVERY_FLAG during cp_ver calculation. Signed-off-by: Chao Yu --- include/f2fs_fs.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index 057adf39f6a9..a92011b83ff5 100644 --- a/include/f2fs_fs.h +++ b/inclu

Re: [f2fs-dev] [PATCH RFC] f2fs: combine nat_bits and free_nid_bitmap cache

2017-03-01 Thread Kinglong Mee
On 3/2/2017 09:35, Chao Yu wrote: > On 2017/3/1 21:09, Kinglong Mee wrote: >> On 3/1/2017 17:10, Chao Yu wrote: >>> Both nat_bits cache and free_nid_bitmap cache provide same functionality >>> as a intermediate cache between free nid cache and disk, but with >>> different granularity of indicating