Re: [f2fs-dev] [PATCH 1/6] f2fs: call f2fs_balance_fs outside of locked page
From: Chao Yu
Date: Mon Dec 09 2019 - 21:09:30 EST
On 2019/12/10 6:23, Jaegeuk Kim wrote:
> Otherwise, we can hit deadlock by waiting for the locked page in
> move_data_block in GC.
>
> Thread A Thread B
> - do_page_mkwrite
> - f2fs_vm_page_mkwrite
> - lock_page
> - f2fs_balance_fs
> - mutex_lock(gc_mutex)
> - f2fs_gc
> - do_garbage_collect
> - ra_data_block
> - grab_cache_page
> - f2fs_balance_fs
> - mutex_lock(gc_mutex)
>
> Fixes: 39a8695824510 ("f2fs: refactor ->page_mkwrite() flow")
> Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
Reviewed-by: Chao Yu <yuchao0@xxxxxxxxxx>
Thanks,