mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-19 20:56:31 +07:00
fs: nfs: return per memcg count for xattr shrinkers
The list_lru_count() returns the pre node count, but the new xattr shrinkers are memcg aware, so the shrinkers should return per memcg count by calling list_lru_shrink_count() instead. Otherwise over-shrink might be experienced. The problem was spotted by visual code inspection. Cc: Trond Myklebust <trond.myklebust@hammerspace.com> Cc: Anna Schumaker <anna.schumaker@netapp.com> Cc: Frank van der Linden <fllinden@amazon.com> Signed-off-by: Yang Shi <shy828301@gmail.com> Reviewed-by: Frank van der Linden <fllinden@amazon.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
b4868b44c5
commit
5904c16d22
@ -881,7 +881,7 @@ nfs4_xattr_cache_count(struct shrinker *shrink, struct shrink_control *sc)
|
||||
{
|
||||
unsigned long count;
|
||||
|
||||
count = list_lru_count(&nfs4_xattr_cache_lru);
|
||||
count = list_lru_shrink_count(&nfs4_xattr_cache_lru, sc);
|
||||
return vfs_pressure_ratio(count);
|
||||
}
|
||||
|
||||
@ -975,7 +975,7 @@ nfs4_xattr_entry_count(struct shrinker *shrink, struct shrink_control *sc)
|
||||
lru = (shrink == &nfs4_xattr_large_entry_shrinker) ?
|
||||
&nfs4_xattr_large_entry_lru : &nfs4_xattr_entry_lru;
|
||||
|
||||
count = list_lru_count(lru);
|
||||
count = list_lru_shrink_count(lru, sc);
|
||||
return vfs_pressure_ratio(count);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user