Commit 2ade4de871172b17dd81b336cf0488a83885ffde

Authored by Qiang Huang
Committed by Linus Torvalds
1 parent f35c3a8eed

memcg, kmem: rename cache_from_memcg to cache_from_memcg_idx

We can't see the relationship with memcg from the parameters,
so the name with memcg_idx would be more reasonable.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Glauber Costa <glommer@parallels.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 4 changed files with 7 additions and 5 deletions Side-by-side Diff

... ... @@ -3982,7 +3982,7 @@
3982 3982  
3983 3983 VM_BUG_ON(!mutex_is_locked(&slab_mutex));
3984 3984 for_each_memcg_cache_index(i) {
3985   - c = cache_from_memcg(cachep, i);
  3985 + c = cache_from_memcg_idx(cachep, i);
3986 3986 if (c)
3987 3987 /* return value determined by the parent cache only */
3988 3988 __do_tune_cpucache(c, limit, batchcount, shared, gfp);
... ... @@ -160,7 +160,8 @@
160 160 return s->name;
161 161 }
162 162  
163   -static inline struct kmem_cache *cache_from_memcg(struct kmem_cache *s, int idx)
  163 +static inline struct kmem_cache *
  164 +cache_from_memcg_idx(struct kmem_cache *s, int idx)
164 165 {
165 166 if (!s->memcg_params)
166 167 return NULL;
... ... @@ -204,7 +205,8 @@
204 205 return s->name;
205 206 }
206 207  
207   -static inline struct kmem_cache *cache_from_memcg(struct kmem_cache *s, int idx)
  208 +static inline struct kmem_cache *
  209 +cache_from_memcg_idx(struct kmem_cache *s, int idx)
208 210 {
209 211 return NULL;
210 212 }
... ... @@ -571,7 +571,7 @@
571 571 return;
572 572  
573 573 for_each_memcg_cache_index(i) {
574   - c = cache_from_memcg(s, i);
  574 + c = cache_from_memcg_idx(s, i);
575 575 if (!c)
576 576 continue;
577 577  
... ... @@ -4983,7 +4983,7 @@
4983 4983 * through the descendants with best-effort propagation.
4984 4984 */
4985 4985 for_each_memcg_cache_index(i) {
4986   - struct kmem_cache *c = cache_from_memcg(s, i);
  4986 + struct kmem_cache *c = cache_from_memcg_idx(s, i);
4987 4987 if (c)
4988 4988 attribute->store(c, buf, len);
4989 4989 }