[f2fs-dev] [PATCH] f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc

2018-07-29 Thread Jaegeuk Kim
The f2fs_gc() called by f2fs_balance_fs() requires to be called outside of fi->i_gc_rwsem[WRITE], since f2fs_gc() can try to grab it in a loop. If it hits the miximum retrials in GC, let's give a chance to release gc_mutex for a short time in order not to go into live lock in the worst case. Sign

Re: [f2fs-dev] [PATCH] f2fs: avoid race between zero_range and background GC

2018-07-29 Thread Jaegeuk Kim
On 07/28, Jaegeuk Kim wrote: > On 07/29, Chao Yu wrote: > > On 2018/7/29 10:59, Jaegeuk Kim wrote: > > > On 07/29, Chao Yu wrote: > > >> On 2018/7/29 10:02, Jaegeuk Kim wrote: > > >>> On 07/27, Chao Yu wrote: > > On 2018/7/27 18:29, Jaegeuk Kim wrote: > > > On 07/26, Chao Yu wrote: > > >>>

Re: [f2fs-dev] [PATCH] f2fs: avoid race between zero_range and background GC

2018-07-29 Thread Chao Yu
On 2018/7/30 9:38, Jaegeuk Kim wrote: > On 07/28, Jaegeuk Kim wrote: >> On 07/29, Chao Yu wrote: >>> On 2018/7/29 10:59, Jaegeuk Kim wrote: On 07/29, Chao Yu wrote: > On 2018/7/29 10:02, Jaegeuk Kim wrote: >> On 07/27, Chao Yu wrote: >>> On 2018/7/27 18:29, Jaegeuk Kim wrote: >

[f2fs-dev] [PATCH v3] fsck.f2fs: write checkpoint out of place first

2018-07-29 Thread Weichao Guo
We may encounter both checkpoints invalid in such a case: 1. write checkpoint A, B, C; 2. sudden power-cut during write checkpoint D; 3. fsck changes the total block count of checkpoint C; 4. sudden power-cut during fsck write checkpoint C in place - - | ver C |

Re: [f2fs-dev] [PATCH] f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc

2018-07-29 Thread Chao Yu
On 2018/7/30 9:32, Jaegeuk Kim wrote: > The f2fs_gc() called by f2fs_balance_fs() requires to be called outside of > fi->i_gc_rwsem[WRITE], since f2fs_gc() can try to grab it in a loop. > > If it hits the miximum retrials in GC, let's give a chance to release > gc_mutex for a short time in order n

Re: [f2fs-dev] [PATCH] f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc

2018-07-29 Thread Jaegeuk Kim
On 07/30, Chao Yu wrote: > On 2018/7/30 9:32, Jaegeuk Kim wrote: > > The f2fs_gc() called by f2fs_balance_fs() requires to be called outside of > > fi->i_gc_rwsem[WRITE], since f2fs_gc() can try to grab it in a loop. > > > > If it hits the miximum retrials in GC, let's give a chance to release > >

Re: [f2fs-dev] [PATCH] f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc

2018-07-29 Thread Chao Yu
On 2018/7/30 12:18, Jaegeuk Kim wrote: > On 07/30, Chao Yu wrote: >> On 2018/7/30 9:32, Jaegeuk Kim wrote: >>> The f2fs_gc() called by f2fs_balance_fs() requires to be called outside of >>> fi->i_gc_rwsem[WRITE], since f2fs_gc() can try to grab it in a loop. >>> >>> If it hits the miximum retrials

Re: [f2fs-dev] [PATCH v3] fsck.f2fs: write checkpoint out of place first

2018-07-29 Thread Chao Yu
Hi Weichao, On 2018/7/30 18:46, Weichao Guo wrote: Could you check and adjust your server's date, it looks like we are receiving patch from future. ;) > We may encounter both checkpoints invalid in such a case: > 1. write checkpoint A, B, C; > 2. sudden power-cut during write checkpoint D; > 3.

Re: [f2fs-dev] [PATCH v3] fsck.f2fs: write checkpoint out of place first

2018-07-29 Thread guoweichao
On 2018/7/30 14:41, Chao Yu wrote: > Hi Weichao, > > On 2018/7/30 18:46, Weichao Guo wrote: > > Could you check and adjust your server's date, it looks like we are receiving > patch from future. ;) > Oh, I didn't notice that. It will not happen any more. Thanks, >> We may encounter both che