mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-02-05 13:55:20 +07:00
staging: erofs: remove rcu_read_lock() in erofs_try_to_free_cached_page
page_private(page) cannot be changed if page lock is taken. Besides, the corresponding workgroup won't be freed if the page is already protected by page lock, therefore no need to take rcu read lock. Signed-off-by: Gao Xiang <gaoxiang25@huawei.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
62dc45979f
commit
047d4abc4d
@ -238,14 +238,9 @@ int erofs_try_to_free_cached_page(struct address_space *mapping,
|
|||||||
{
|
{
|
||||||
struct erofs_sb_info *const sbi = EROFS_SB(mapping->host->i_sb);
|
struct erofs_sb_info *const sbi = EROFS_SB(mapping->host->i_sb);
|
||||||
const unsigned int clusterpages = erofs_clusterpages(sbi);
|
const unsigned int clusterpages = erofs_clusterpages(sbi);
|
||||||
|
struct z_erofs_vle_workgroup *const grp = (void *)page_private(page);
|
||||||
struct z_erofs_vle_workgroup *grp;
|
|
||||||
int ret = 0; /* 0 - busy */
|
int ret = 0; /* 0 - busy */
|
||||||
|
|
||||||
/* prevent the workgroup from being freed */
|
|
||||||
rcu_read_lock();
|
|
||||||
grp = (void *)page_private(page);
|
|
||||||
|
|
||||||
if (erofs_workgroup_try_to_freeze(&grp->obj, 1)) {
|
if (erofs_workgroup_try_to_freeze(&grp->obj, 1)) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
@ -257,12 +252,11 @@ int erofs_try_to_free_cached_page(struct address_space *mapping,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
erofs_workgroup_unfreeze(&grp->obj, 1);
|
erofs_workgroup_unfreeze(&grp->obj, 1);
|
||||||
}
|
|
||||||
rcu_read_unlock();
|
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ClearPagePrivate(page);
|
ClearPagePrivate(page);
|
||||||
put_page(page);
|
put_page(page);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user