linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Qiang Huang <h.huangqiang@huawei.com>
To: akpm@linux-foundation.org
Cc: hannes@cmpxchg.org, mhocko@suse.cz, cl@linux-foundation.org,
	penberg@kernel.org, glommer@parallels.com, rientjes@google.com,
	cgroups@vger.kernel.org, linux-mm@kvack.org, lizefan@huawei.com
Subject: [PATCH 2/3] memcg, kmem: rename cache_from_memcg to cache_from_memcg_idx
Date: Wed, 23 Oct 2013 19:31:14 +0800	[thread overview]
Message-ID: <1382527875-10112-3-git-send-email-h.huangqiang@huawei.com> (raw)
In-Reply-To: <1382527875-10112-1-git-send-email-h.huangqiang@huawei.com>

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>
---
 mm/slab.c        | 2 +-
 mm/slab.h        | 6 ++++--
 mm/slab_common.c | 2 +-
 mm/slub.c        | 2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 8ccd296..3a90fbc 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3977,7 +3977,7 @@ static int do_tune_cpucache(struct kmem_cache *cachep, int limit,
 
 	VM_BUG_ON(!mutex_is_locked(&slab_mutex));
 	for_each_memcg_cache_index(i) {
-		c = cache_from_memcg(cachep, i);
+		c = cache_from_memcg_idx(cachep, i);
 		if (c)
 			/* return value determined by the parent cache only */
 			__do_tune_cpucache(c, limit, batchcount, shared, gfp);
diff --git a/mm/slab.h b/mm/slab.h
index f96b49e..a6d5bee 100644
--- a/mm/slab.h
+++ b/mm/slab.h
@@ -160,7 +160,8 @@ static inline const char *cache_name(struct kmem_cache *s)
 	return s->name;
 }
 
-static inline struct kmem_cache *cache_from_memcg(struct kmem_cache *s, int idx)
+static inline struct kmem_cache *
+cache_from_memcg_idx(struct kmem_cache *s, int idx)
 {
 	return s->memcg_params->memcg_caches[idx];
 }
@@ -202,7 +203,8 @@ static inline const char *cache_name(struct kmem_cache *s)
 	return s->name;
 }
 
-static inline struct kmem_cache *cache_from_memcg(struct kmem_cache *s, int idx)
+static inline struct kmem_cache *
+cache_from_memcg_idx(struct kmem_cache *s, int idx)
 {
 	return NULL;
 }
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 2d41450..34d1551 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -552,7 +552,7 @@ memcg_accumulate_slabinfo(struct kmem_cache *s, struct slabinfo *info)
 		return;
 
 	for_each_memcg_cache_index(i) {
-		c = cache_from_memcg(s, i);
+		c = cache_from_memcg_idx(s, i);
 		if (!c)
 			continue;
 
diff --git a/mm/slub.c b/mm/slub.c
index 0f3b6c1..0fa9930 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4999,7 +4999,7 @@ static ssize_t slab_attr_store(struct kobject *kobj,
 		 * through the descendants with best-effort propagation.
 		 */
 		for_each_memcg_cache_index(i) {
-			struct kmem_cache *c = cache_from_memcg(s, i);
+			struct kmem_cache *c = cache_from_memcg_idx(s, i);
 			if (c)
 				attribute->store(c, buf, len);
 		}
-- 
1.8.3


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2013-10-23 11:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-23 11:31 [PATCH 0/3] a few cleanups about kmem code Qiang Huang
2013-10-23 11:31 ` [PATCH 1/3] memcg, kmem: Use is_root_cache instead of hard code Qiang Huang
2013-10-24 17:30   ` Pekka Enberg
2013-10-31  2:35   ` David Rientjes
2013-10-23 11:31 ` Qiang Huang [this message]
2013-10-24 17:31   ` [PATCH 2/3] memcg, kmem: rename cache_from_memcg to cache_from_memcg_idx Pekka Enberg
2013-10-31  2:37   ` David Rientjes
2013-10-23 11:31 ` [PATCH 3/3] memcg, kmem: use cache_from_memcg_idx instead of hard code Qiang Huang
2013-10-24 17:31   ` Pekka Enberg
2013-10-31  2:40   ` David Rientjes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1382527875-10112-3-git-send-email-h.huangqiang@huawei.com \
    --to=h.huangqiang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=cl@linux-foundation.org \
    --cc=glommer@parallels.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=lizefan@huawei.com \
    --cc=mhocko@suse.cz \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox