Re: [PATCH 02/10] staging: erofs: fix race when the managed cache is enabled

2018-11-22 Thread Greg Kroah-Hartman
On Thu, Nov 22, 2018 at 08:41:15PM +0800, Gao Xiang wrote: > Hi Greg, > > On 2018/11/22 20:26, Greg Kroah-Hartman wrote: > > Ugh, every page? Ok, nevermind, I take back my objections. You all are > > crazy and need to do crazy things like this :) > > ...Do you have some idea about this? ... I t

Re: [PATCH 02/10] staging: erofs: fix race when the managed cache is enabled

2018-11-22 Thread Gao Xiang
Hi Greg, On 2018/11/22 20:26, Greg Kroah-Hartman wrote: > Ugh, every page? Ok, nevermind, I take back my objections. You all are > crazy and need to do crazy things like this :) ...Do you have some idea about this? ... I think it is fairly normal... :( We have a large number of managed workgro

Re: [PATCH 02/10] staging: erofs: fix race when the managed cache is enabled

2018-11-22 Thread Greg Kroah-Hartman
On Thu, Nov 22, 2018 at 07:43:50PM +0800, Gao Xiang wrote: > Hi Greg, > > On 2018/11/22 19:06, Greg Kroah-Hartman wrote: > > On Thu, Nov 22, 2018 at 06:42:52PM +0800, Gao Xiang wrote: > >> Hi Greg, > >> > >> On 2018/11/22 18:17, Greg Kroah-Hartman wrote: > >>> Any specific reason why you are not u

Re: [PATCH 02/10] staging: erofs: fix race when the managed cache is enabled

2018-11-22 Thread Gao Xiang
Hi Greg, On 2018/11/22 19:06, Greg Kroah-Hartman wrote: > On Thu, Nov 22, 2018 at 06:42:52PM +0800, Gao Xiang wrote: >> Hi Greg, >> >> On 2018/11/22 18:17, Greg Kroah-Hartman wrote: >>> Any specific reason why you are not using the refcount.h api instead of >>> "doing it yourself" with atomic_inc/

Re: [PATCH 02/10] staging: erofs: fix race when the managed cache is enabled

2018-11-22 Thread Greg Kroah-Hartman
On Thu, Nov 22, 2018 at 06:42:52PM +0800, Gao Xiang wrote: > Hi Greg, > > On 2018/11/22 18:17, Greg Kroah-Hartman wrote: > > Any specific reason why you are not using the refcount.h api instead of > > "doing it yourself" with atomic_inc/dec()? > > > > I'm not rejecting this, just curious. > > As

Re: [PATCH 02/10] staging: erofs: fix race when the managed cache is enabled

2018-11-22 Thread Gao Xiang
Hi Greg, On 2018/11/22 18:17, Greg Kroah-Hartman wrote: > Any specific reason why you are not using the refcount.h api instead of > "doing it yourself" with atomic_inc/dec()? > > I'm not rejecting this, just curious. As I explained in the previous email, Re: [PATCH 04/10] staging: erofs: fix `er

Re: [PATCH 02/10] staging: erofs: fix race when the managed cache is enabled

2018-11-22 Thread Greg Kroah-Hartman
On Tue, Nov 20, 2018 at 10:34:17PM +0800, 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 f

Re: [PATCH 02/10] staging: erofs: fix race when the managed cache is enabled

2018-11-22 Thread Greg Kroah-Hartman
On Tue, Nov 20, 2018 at 10:34:17PM +0800, 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 f

[PATCH 02/10] staging: erofs: fix race when the managed cache is enabled

2018-11-20 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, 1