diff options
| author | Gao Xiang <gaoxiang25@huawei.com> | 2018-11-23 01:16:00 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-23 10:53:07 +0100 |
| commit | 51232df5e4b268936beccde5248f312a316800be (patch) | |
| tree | 259dae2be7417d5555ab84bea3ef40846bcdd1d0 /tools/perf/scripts/python | |
| parent | staging: erofs: fix the definition of DBG_BUGON (diff) | |
| download | linux-51232df5e4b268936beccde5248f312a316800be.tar.gz linux-51232df5e4b268936beccde5248f312a316800be.zip | |
staging: erofs: fix race when the managed cache is enabled
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) refcnt = 1
...
workgroup_unfreeze(grp, 1) refcnt = 1
workgroup_get(grp) refcnt = 2 (x)
workgroup_put(grp) refcnt = 1 (x)
...unexpected behaviors
* grp is detached but still used, which violates cache-managed
freeze constraint.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
