aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorQiang Huang <h.huangqiang@huawei.com>2013-11-12 18:08:23 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-12 22:09:10 -0500
commit2ade4de871172b17dd81b336cf0488a83885ffde (patch)
tree9bdebd7f22388e23386c35cdfe0f9a965b414b36 /mm
parentf35c3a8eed52878c2dde9c4b9a87b276127f7f8d (diff)
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>
Diffstat (limited to 'mm')
-rw-r--r--mm/slab.c2
-rw-r--r--mm/slab.h6
-rw-r--r--mm/slab_common.c2
-rw-r--r--mm/slub.c2
4 files changed, 7 insertions, 5 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 2580db062df9..0c8967bb2018 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3982,7 +3982,7 @@ static int do_tune_cpucache(struct kmem_cache *cachep, int limit,
3982 3982
3983 VM_BUG_ON(!mutex_is_locked(&slab_mutex)); 3983 VM_BUG_ON(!mutex_is_locked(&slab_mutex));
3984 for_each_memcg_cache_index(i) { 3984 for_each_memcg_cache_index(i) {
3985 c = cache_from_memcg(cachep, i); 3985 c = cache_from_memcg_idx(cachep, i);
3986 if (c) 3986 if (c)
3987 /* return value determined by the parent cache only */ 3987 /* return value determined by the parent cache only */
3988 __do_tune_cpucache(c, limit, batchcount, shared, gfp); 3988 __do_tune_cpucache(c, limit, batchcount, shared, gfp);
diff --git a/mm/slab.h b/mm/slab.h
index a535033f7e9a..0859c4241ba1 100644
--- a/mm/slab.h
+++ b/mm/slab.h
@@ -160,7 +160,8 @@ static inline const char *cache_name(struct kmem_cache *s)
160 return s->name; 160 return s->name;
161} 161}
162 162
163static inline struct kmem_cache *cache_from_memcg(struct kmem_cache *s, int idx) 163static inline struct kmem_cache *
164cache_from_memcg_idx(struct kmem_cache *s, int idx)
164{ 165{
165 if (!s->memcg_params) 166 if (!s->memcg_params)
166 return NULL; 167 return NULL;
@@ -204,7 +205,8 @@ static inline const char *cache_name(struct kmem_cache *s)
204 return s->name; 205 return s->name;
205} 206}
206 207
207static inline struct kmem_cache *cache_from_memcg(struct kmem_cache *s, int idx) 208static inline struct kmem_cache *
209cache_from_memcg_idx(struct kmem_cache *s, int idx)
208{ 210{
209 return NULL; 211 return NULL;
210} 212}
diff --git a/mm/slab_common.c b/mm/slab_common.c
index e2e98af703ea..0b7bb399b0e4 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -571,7 +571,7 @@ memcg_accumulate_slabinfo(struct kmem_cache *s, struct slabinfo *info)
571 return; 571 return;
572 572
573 for_each_memcg_cache_index(i) { 573 for_each_memcg_cache_index(i) {
574 c = cache_from_memcg(s, i); 574 c = cache_from_memcg_idx(s, i);
575 if (!c) 575 if (!c)
576 continue; 576 continue;
577 577
diff --git a/mm/slub.c b/mm/slub.c
index c3eb3d3ca835..92737a0b787b 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4983,7 +4983,7 @@ static ssize_t slab_attr_store(struct kobject *kobj,
4983 * through the descendants with best-effort propagation. 4983 * through the descendants with best-effort propagation.
4984 */ 4984 */
4985 for_each_memcg_cache_index(i) { 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 if (c) 4987 if (c)
4988 attribute->store(c, buf, len); 4988 attribute->store(c, buf, len);
4989 } 4989 }