Commit 7f7ab33
NFSv4.2: fix wrong shrinker_id
Currently, the list_lru::shrinker_id corresponding to the nfs4_xattr
shrinkers is wrong:
>>> prog["nfs4_xattr_cache_lru"].shrinker_id
(int)0
>>> prog["nfs4_xattr_entry_lru"].shrinker_id
(int)0
>>> prog["nfs4_xattr_large_entry_lru"].shrinker_id
(int)0
>>> prog["nfs4_xattr_cache_shrinker"].id
(int)18
>>> prog["nfs4_xattr_entry_shrinker"].id
(int)19
>>> prog["nfs4_xattr_large_entry_shrinker"].id
(int)20
This is not what we expect, which will cause these shrinkers
not to be found in shrink_slab_memcg().
We should assign shrinker::id before calling list_lru_init_memcg(),
so that the corresponding list_lru::shrinker_id will be assigned
the correct value like below:
>>> prog["nfs4_xattr_cache_lru"].shrinker_id
(int)16
>>> prog["nfs4_xattr_entry_lru"].shrinker_id
(int)17
>>> prog["nfs4_xattr_large_entry_lru"].shrinker_id
(int)18
>>> prog["nfs4_xattr_cache_shrinker"].id
(int)16
>>> prog["nfs4_xattr_entry_shrinker"].id
(int)17
>>> prog["nfs4_xattr_large_entry_shrinker"].id
(int)18
So just do it.
Fixes: 95ad37f ("NFSv4.2: add client side xattr caching.")
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>1 parent 6ad477a commit 7f7ab33
1 file changed
Lines changed: 44 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
991 | 991 | | |
992 | 992 | | |
993 | 993 | | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
994 | 1017 | | |
995 | 1018 | | |
996 | 1019 | | |
| |||
1002 | 1025 | | |
1003 | 1026 | | |
1004 | 1027 | | |
1005 | | - | |
1006 | | - | |
1007 | | - | |
1008 | | - | |
1009 | | - | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
1016 | | - | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
1021 | 1031 | | |
1022 | 1032 | | |
1023 | 1033 | | |
1024 | | - | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
1025 | 1037 | | |
1026 | | - | |
| 1038 | + | |
1027 | 1039 | | |
1028 | | - | |
1029 | | - | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
1030 | 1043 | | |
1031 | 1044 | | |
1032 | 1045 | | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
| 1046 | + | |
| 1047 | + | |
1038 | 1048 | | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
1043 | 1052 | | |
1044 | 1053 | | |
1045 | 1054 | | |
1046 | 1055 | | |
1047 | 1056 | | |
1048 | 1057 | | |
1049 | 1058 | | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
1055 | | - | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
1056 | 1065 | | |
1057 | 1066 | | |
0 commit comments