Re: [f2fs-dev] [PATCH] f2fs: add fi->commit_lock to protect commit GCed pages

2018-02-09 Thread Yunlong Song
The problem is that you can not find a proper value of the threshold time, when f2fs_gc select the GCed data page of the atomic file (which has atomic started but not atomic committed yet), then f2fs_gc will run into loop, and all the f2fs ops will be blocked in f2fs_balane_fs. If the threshold

Re: [f2fs-dev] [PATCH] f2fs: add fi->commit_lock to protect commit GCed pages

2018-02-09 Thread Chao Yu
On 2018/2/9 21:29, Yunlong Song wrote: > Back to the problem, if we skip out, then the f2fs_gc will go > into dead loop if the apps only atomic start but never atomic That's another issue, which I have suggest to set a threshold time to release atomic/volatile pages by balance_fs_bg. Thanks, >

Re: [f2fs-dev] [PATCH] f2fs: add fi->commit_lock to protect commit GCed pages

2018-02-09 Thread Yunlong Song
Back to the problem, if we skip out, then the f2fs_gc will go into dead loop if the apps only atomic start but never atomic commit. The main aim of my two patches is to remove the skip action to avoid the dead loop. On 2018/2/9 21:26, Chao Yu wrote: On 2018/2/9 20:56, Yunlong Song wrote: As

Re: [f2fs-dev] [PATCH] f2fs: add fi->commit_lock to protect commit GCed pages

2018-02-09 Thread Chao Yu
On 2018/2/9 20:56, Yunlong Song wrote: > As what I point in last mail, if the atomic file is not committed > yet, gc_data_segment will register_inmem_page the GCed data pages. We will skip GCing that page as below check: - move_data_{page,block} - f2fs_is_atomic_file() skip out; No?

Re: [f2fs-dev] [PATCH] f2fs: add fi->commit_lock to protect commit GCed pages

2018-02-09 Thread Yunlong Song
As what I point in last mail, if the atomic file is not committed yet, gc_data_segment will register_inmem_page the GCed data pages. This will cause these data pages written twice, the first write happens in move_data_page->do_write_data_page, and the second write happens in later

Re: [f2fs-dev] [PATCH] f2fs: add fi->commit_lock to protect commit GCed pages

2018-02-09 Thread Chao Yu
On 2018/2/8 11:11, Yunlong Song wrote: > Then the GCed data pages are totally mixed with the inmem atomic pages, If we add dio_rwsem, GC flow is exclude with atomic write flow. There will be not race case to mix GCed page into atomic pages. Or you mean: -

Re: [f2fs-dev] [PATCH] f2fs: add fi->commit_lock to protect commit GCed pages

2018-02-07 Thread Yunlong Song
Then the GCed data pages are totally mixed with the inmem atomic pages, this will cause the atomic commit ops write the GCed data pages twice (the first write happens in GC). How about using the early two patches to separate the inmem data pages and GCed data pages, and use dio_rwsem instead of

Re: [f2fs-dev] [PATCH] f2fs: add fi->commit_lock to protect commit GCed pages

2018-02-07 Thread Chao Yu
On 2018/2/6 11:49, Yunlong Song wrote: > This patch adds fi->commit_lock to avoid the case that GCed node pages > are committed but GCed data pages are not committed. This can avoid the > db file run into inconsistent state when sudden-power-off happens if > data pages of atomic file is allowed to