Re: [PATCH chao/erofs-dev rebased v2 05/12] staging: erofs: fix race when the managed cache is enabled

2018-11-19 Thread Gao Xiang
Hi Chao, On 2018/11/20 11:24, Chao Yu wrote: >> +/* >> + * it's safe to decrease since the workgroup isn't visible >> + * and refcount >= 2 (cannot be freezed). >> + */ >> +atomic_dec(>refcount); > How about: > > #define

Re: [PATCH chao/erofs-dev rebased v2 05/12] staging: erofs: fix race when the managed cache is enabled

2018-11-19 Thread Chao Yu
On 2018/11/14 23:25, Gao Xiang wrote: > When the managed cache is enabled, the last reference count > of a workgroup must be used for its workstation. > > Otherwise, it could lead to incorrect (un)freezes in > the reclaim path, and it would be harmful. > > A typical race as follows: > > Thread

[PATCH chao/erofs-dev rebased v2 05/12] staging: erofs: fix race when the managed cache is enabled

2018-11-14 Thread Gao Xiang
When the managed cache is enabled, the last reference count of a workgroup must be used for its workstation. Otherwise, it could lead to incorrect (un)freezes in the reclaim path, and it would be harmful. A typical race as follows: Thread 1 (In the reclaim path) Thread 2 workgroup_freeze(grp,