Re: [PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc

2017-11-16 Thread Chao Yu
On 2017/11/17 11:30, Yunlong Song wrote: > How about add file_write_and_wait_range in __write_node_page as following: > if (atomic && !test_opt(sbi, NOBARRIER)) { > file_write_and_wait_range(file, 0, LLONG_MAX); Nope, GCed encrypted data wouldn't be cached in inode page cache. I don't think

Re: [PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc

2017-11-16 Thread Chao Yu
On 2017/11/17 11:30, Yunlong Song wrote: > How about add file_write_and_wait_range in __write_node_page as following: > if (atomic && !test_opt(sbi, NOBARRIER)) { > file_write_and_wait_range(file, 0, LLONG_MAX); Nope, GCed encrypted data wouldn't be cached in inode page cache. I don't think

Re: [PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc

2017-11-16 Thread Yunlong Song
How about add file_write_and_wait_range in __write_node_page as following: if (atomic && !test_opt(sbi, NOBARRIER)) { file_write_and_wait_range(file, 0, LLONG_MAX); fio.op_flags |= REQ_PREFLUSH | REQ_FUA; } The all the GCed data will be flushed to non-volatile before last node write

Re: [PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc

2017-11-16 Thread Yunlong Song
How about add file_write_and_wait_range in __write_node_page as following: if (atomic && !test_opt(sbi, NOBARRIER)) { file_write_and_wait_range(file, 0, LLONG_MAX); fio.op_flags |= REQ_PREFLUSH | REQ_FUA; } The all the GCed data will be flushed to non-volatile before last node write

Re: [PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc

2017-11-16 Thread Chao Yu
On 2017/11/17 11:04, Yunlong Song wrote: > The atomic commit will trigger: > -f2fs_do_sync_file(filp, 0, LLONG_MAX, 0, true) > -file_write_and_wait_range(file, 0, LLONG_MAX) > -fsync_node_pages > -__write_node_page > -REQ_PREFLUSH | REQ_FUA > >

Re: [PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc

2017-11-16 Thread Chao Yu
On 2017/11/17 11:04, Yunlong Song wrote: > The atomic commit will trigger: > -f2fs_do_sync_file(filp, 0, LLONG_MAX, 0, true) > -file_write_and_wait_range(file, 0, LLONG_MAX) > -fsync_node_pages > -__write_node_page > -REQ_PREFLUSH | REQ_FUA > >

Re: [PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc

2017-11-16 Thread Yunlong Song
The atomic commit will trigger: -f2fs_do_sync_file(filp, 0, LLONG_MAX, 0, true) -file_write_and_wait_range(file, 0, LLONG_MAX) -fsync_node_pages -__write_node_page -REQ_PREFLUSH | REQ_FUA So data is flushed to non-volatile before last node write

Re: [PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc

2017-11-16 Thread Yunlong Song
The atomic commit will trigger: -f2fs_do_sync_file(filp, 0, LLONG_MAX, 0, true) -file_write_and_wait_range(file, 0, LLONG_MAX) -fsync_node_pages -__write_node_page -REQ_PREFLUSH | REQ_FUA So data is flushed to non-volatile before last node write

Re: [PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc

2017-11-16 Thread Chao Yu
On 2017/11/17 8:58, Yunlong Song wrote: > Is there any problem if just deleting the judgement condition in this patch? IIRC, dirty node comes from data segment GC can be writebacked & flushed during atomic commit, but related data will still be in inner bio cache, after later SPOR, data would be

Re: [PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc

2017-11-16 Thread Chao Yu
On 2017/11/17 8:58, Yunlong Song wrote: > Is there any problem if just deleting the judgement condition in this patch? IIRC, dirty node comes from data segment GC can be writebacked & flushed during atomic commit, but related data will still be in inner bio cache, after later SPOR, data would be

Re: [PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc

2017-11-16 Thread Yunlong Song
Is there any problem if just deleting the judgement condition in this patch? On 2017/11/8 17:28, Chao Yu wrote: On 2017/11/8 10:34, Yunlong Song wrote: If some files are opened with atomic flag and have not commited yet, at the same time, if all the target victim segments have at least one

Re: [PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc

2017-11-16 Thread Yunlong Song
Is there any problem if just deleting the judgement condition in this patch? On 2017/11/8 17:28, Chao Yu wrote: On 2017/11/8 10:34, Yunlong Song wrote: If some files are opened with atomic flag and have not commited yet, at the same time, if all the target victim segments have at least one

Re: [PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc

2017-11-08 Thread Chao Yu
On 2017/11/8 10:34, Yunlong Song wrote: > If some files are opened with atomic flag and have not commited yet, at > the same time, if all the target victim segments have at least one page > of these atomic files, then f2fs gc will fail to do gc and hangs in the > process of go to gc_more, since

Re: [PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc

2017-11-08 Thread Chao Yu
On 2017/11/8 10:34, Yunlong Song wrote: > If some files are opened with atomic flag and have not commited yet, at > the same time, if all the target victim segments have at least one page > of these atomic files, then f2fs gc will fail to do gc and hangs in the > process of go to gc_more, since

[PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc

2017-11-07 Thread Yunlong Song
If some files are opened with atomic flag and have not commited yet, at the same time, if all the target victim segments have at least one page of these atomic files, then f2fs gc will fail to do gc and hangs in the process of go to gc_more, since gc_date_segment will not move any data and

[PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc

2017-11-07 Thread Yunlong Song
If some files are opened with atomic flag and have not commited yet, at the same time, if all the target victim segments have at least one page of these atomic files, then f2fs gc will fail to do gc and hangs in the process of go to gc_more, since gc_date_segment will not move any data and